Skip to content

Commit d8f1bde

Browse files
committed
ci(GITHUB): point stage to vercel
1 parent 883e8e8 commit d8f1bde

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ name: Music Analytics Project CI/CD
33

44
# CI_ENVIRONMENT_CONTENT - Environment file content for the ci environment
55
# STAGE_ENVIRONMENT_CONTENT - Environment file content for the ci environment
6-
# STAGE_NETLIFY_SITE_ID - Netlify Stage Site ID
6+
# STAGE_VERCEL_CONFIG - Identify the Vercel Project and Organization
77
# PRODUCTION_ENVIRONMENT_CONTENT - Environment file content for the ci environment
8-
# PRODUCTION_NETLIFY_SITE_ID - Netlify Production Site ID
8+
# PRODUCTION_VERCEL_CONFIG - Identify the Vercel Project and Organization
9+
# VERCEL_TOKEN - The authentication token used by Vercel
910

1011
on:
1112
push:
@@ -128,11 +129,19 @@ jobs:
128129
if: github.ref == 'refs/heads/main'
129130
needs: [configuration, success_notification]
130131
secrets:
131-
FLYIO_API_TOKEN: ${{ secrets.FLYIO_API_TOKEN }}
132+
FILE_CONTENT: ${{ secrets.STAGE_ENVIRONMENT_CONTENT }}
132133
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
133-
uses: cicd-tools-org/cicd-tools/.github/workflows/job-95-container-flyio_deploy.yml@main
134+
ENV_SECRET_1: ${{ secrets.VERCEL_TOKEN }}
135+
ENV_SECRET_2: ${{ secrets.STAGE_VERCEL_CONFIG }}
136+
uses: cicd-tools-org/cicd-tools/.github/workflows/job-40-npm-run_cached_command.yml@main
134137
with:
135-
FLYIO_ENDPOINT_URL: "https://stage-mla.fly.dev"
138+
ADDITIONAL_CACHE_PATHS: "~/.cache/Cypress"
139+
COMMAND: ci:vercel; vercel pull --yes --environment=production --token="${ENV_SECRET_1}"
140+
COMMAND_NAME: Deploy to Stage
141+
CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }}
142+
POST_COMMAND: vercel build --prod --token="${ENV_SECRET_1}" && vercel deploy --prebuilt --prod --token="${ENV_SECRET_1}"
143+
PRE_COMMAND: mkdir -p .vercel && echo "${ENV_SECRET_2}" > .vercel/project.json
144+
SECRET_CONTENT_FILENAME: .env.local
136145
VERBOSE_NOTIFICATIONS: true
137146

138147
deploy_production:
@@ -242,7 +251,6 @@ jobs:
242251
if: github.ref == 'refs/heads/main'
243252
needs: [configuration, deploy_stage]
244253
secrets:
245-
ENV_SECRET_1: "https://stage-mla.fly.dev"
246254
FILE_CONTENT: ${{ secrets.STAGE_ENVIRONMENT_CONTENT }}
247255
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
248256
uses: cicd-tools-org/cicd-tools/.github/workflows/job-40-npm-run_cached_command.yml@main
@@ -251,8 +259,6 @@ jobs:
251259
COMMAND: smoke:ci
252260
COMMAND_NAME: Smoke Tests (Stage)
253261
CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }}
254-
PRE_COMMAND: |
255-
sed -i.bak "s,NEXTAUTH_URL=.*,NEXTAUTH_URL=${ENV_SECRET_1}," .env.local
256262
SECRET_CONTENT_FILENAME: .env.local
257263
VERBOSE_NOTIFICATIONS: true
258264

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"smoke:ci": "npm run smoke:env && npm run smoke:run",
1919
"smoke:dev": "cypress open",
2020
"smoke:env": "ts-node cypress/utils/build.config.ts",
21-
"smoke:run": "cypress run --e2e --headless --config video=false,screenshotOnRunFailure=false",
21+
"smoke:run": "cypress install; cypress run --e2e --headless --config video=false,screenshotOnRunFailure=false",
2222
"start": "next start",
2323
"start:container": "[[ -n \"${ENV_LOCAL_MOUNT}\" ]] && cp \"${ENV_LOCAL_MOUNT}\" .env.local; next start",
2424
"test": "jest --watch"

0 commit comments

Comments
 (0)