Update GitHub Actions runtime actions #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Vercel | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/deploy-vercel.yml" | |
| - "api/**" | |
| - "catpred/web/**" | |
| - "catpred/web/frontend/**" | |
| - "catpred/**" | |
| - "requirements.txt" | |
| - "vercel.json" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: vercel-production-deploy | |
| cancel-in-progress: true | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| steps: | |
| - name: Skip when Vercel credentials are not configured | |
| if: ${{ env.VERCEL_TOKEN == '' || env.VERCEL_ORG_ID == '' || env.VERCEL_PROJECT_ID == '' }} | |
| run: echo "Skipping Vercel deploy because VERCEL_TOKEN / VERCEL_ORG_ID / VERCEL_PROJECT_ID are not configured." | |
| - name: Checkout | |
| if: ${{ env.VERCEL_TOKEN != '' && env.VERCEL_ORG_ID != '' && env.VERCEL_PROJECT_ID != '' }} | |
| uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| if: ${{ env.VERCEL_TOKEN != '' && env.VERCEL_ORG_ID != '' && env.VERCEL_PROJECT_ID != '' }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| - name: Install Vercel CLI | |
| if: ${{ env.VERCEL_TOKEN != '' && env.VERCEL_ORG_ID != '' && env.VERCEL_PROJECT_ID != '' }} | |
| run: npm install --global vercel@latest | |
| - name: Pull Vercel project settings | |
| if: ${{ env.VERCEL_TOKEN != '' && env.VERCEL_ORG_ID != '' && env.VERCEL_PROJECT_ID != '' }} | |
| run: vercel pull --yes --environment=production --token="${VERCEL_TOKEN}" | |
| - name: Deploy | |
| if: ${{ env.VERCEL_TOKEN != '' && env.VERCEL_ORG_ID != '' && env.VERCEL_PROJECT_ID != '' }} | |
| run: vercel deploy --prod --yes --token="${VERCEL_TOKEN}" |