Skip to content

Commit

Permalink
feat: setup vercel cleanup step
Browse files Browse the repository at this point in the history
  • Loading branch information
frattezi committed Jun 18, 2024
1 parent 65a5a11 commit d813ee5
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ name: Preview environment workflow
on: pull_request

jobs:
lint-and-test:
runs-on: ubuntu-latest
# lint-and-test:
# runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 20

- name: Install dependencies
run: yarn
# - name: Install dependencies
# run: yarn

- name: Run lint
run: yarn lint
# - name: Run lint
# run: yarn lint

# - name: Run tests
# run: yarn test
# - name: Run tests
# run: yarn test

build-and-deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,8 +56,11 @@ jobs:
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

- name: Cleanup Preview before deploy
run: vercel ls -m PR_NUMBER=${{ github.event.number }} | grep -o 'https://[^ ]*' | xargs -I {} vercel remove --token=${{ secrets.VERCEL_TOKEN }} {}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} -e PR_NUMBER=${{ github.event.number }}
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} -m PR_NUMBER=${{ github.event.number }}

0 comments on commit d813ee5

Please sign in to comment.