Skip to content

Commit

Permalink
adding preview deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ErwanDecoster committed Dec 9, 2024
1 parent f4ecc5a commit fa760b4
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: preview-ci

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_CONTENT_CREATOR_USECASE_DEMO_PROJECT_ID }}

on:
push:
branches-ignore:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4

- name: Install dependencies
run: |
node -v
npm -v
npm ci --no-fund
- name: Check Prettier
run: npm run check-format

- name: Set Vercel Token
id: set-vercel-token
run: |
if [ "${{ github.actor }}" = "ErwanDecoster" ]; then
echo "vercel_token=${{ secrets.VERCEL_TOKEN_Erwan }}" >> $GITHUB_OUTPUT
else
echo "vercel_token=${{ secrets.VERCEL_TOKEN }}" >> $GITHUB_OUTPUT
fi
- name: Vercel deploy to preview
run: |
npm install --global vercel@latest
vercel pull --yes --environment=preview --scope i-exec --token=${{ steps.set-vercel-token.outputs.vercel_token }}
vercel build --scope i-exec --token=${{ steps.set-vercel-token.outputs.vercel_token }}
vercel deploy --prebuilt --scope i-exec --token=${{ steps.set-vercel-token.outputs.vercel_token }}

0 comments on commit fa760b4

Please sign in to comment.