Skip to content

Commit

Permalink
Merge pull request #54 from iliubinskii/feature/vercel-deployment-fix
Browse files Browse the repository at this point in the history
fix: For vercel deployment hang out
  • Loading branch information
iliubinskii authored Jul 8, 2024
2 parents 31d1bd0 + 3c5a071 commit 65cc58e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/vercel-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@ on:
workflow_dispatch:

jobs:
deploy:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
environment: production
env:
JWT_ADMIN_EMAIL: ${{ vars.JWT_ADMIN_EMAIL }}
JWT_EMAIL: ${{ vars.JWT_EMAIL }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
steps:
- uses: actions/checkout@v2
- name: Deploy to Vercel production
uses: amondnet/vercel-action@v25
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID }}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID }}
vercel-args: --prod
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Deploy to Vercel production
run: echo "BASE_URL=$(npx vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --yes)" >> $GITHUB_ENV
- name: Output environment variables
run: |
echo "CI is $CI"
echo "BASE_URL is $BASE_URL"
23 changes: 4 additions & 19 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,11 @@ on:
workflow_dispatch:

jobs:
deploy:
timeout-minutes: 60
runs-on: ubuntu-latest
outputs:
url: ${{ steps.deploy.outputs.preview-url }}
steps:
- uses: actions/checkout@v2
- name: Deploy to Vercel preview
id: deploy
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID }}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID }}

test:
needs: deploy
timeout-minutes: 60
runs-on: ubuntu-latest
environment: preview
env:
BASE_URL: ${{ needs.deploy.outputs.url }}
JWT_ADMIN_EMAIL: ${{ vars.JWT_ADMIN_EMAIL }}
JWT_EMAIL: ${{ vars.JWT_EMAIL }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
Expand All @@ -38,12 +21,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Deploy to Vercel preview
run: echo "BASE_URL=$(npx vercel --token ${{ secrets.VERCEL_TOKEN }} --yes)" >> $GITHUB_ENV
- name: Output environment variables
run: |
echo "CI is $CI"
echo "BASE_URL is $BASE_URL"
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
- name: Test with Playwright
Expand Down

0 comments on commit 65cc58e

Please sign in to comment.