pataruco is deploying FEWD to vercel production #43
This file contains 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 NR2F1 website to Vercel production | |
run-name: ${{ github.actor }} is deploying FEWD to vercel production | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Select the tag to deploy to production' | |
required: true | |
type: string | |
default: 'latest' | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
jobs: | |
deploy-fewd-to-vercel-production: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: ${{ steps.deploy.outputs.url }} | |
outputs: | |
url: ${{ steps.deploy.outputs.url }} | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: checkout tag | |
run: git checkout ${{ github.event.inputs.tag }} | |
- name: Set environment and install dependencies | |
uses: ./.github/actions/prepare | |
- name: Pull Vercel environment information | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build project artifacts | |
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
env: | |
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE_ID }} | |
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }} | |
NEXT_PUBLIC_GIVEBUTTER_API_KEY: ${{ secrets.NEXT_PUBLIC_GIVEBUTTER_API_KEY }} | |
- name: Deploy project artifacts to Vercel | |
id: deploy | |
run: echo "url=$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT | |
ci-validation: | |
name: CI validation | |
needs: [deploy-fewd-to-vercel-production] | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Check jobs for errors | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const checkJobsForErrors = require('./.github/workflows/js/check-for-errors.js'); | |
const jobs = ${{ toJSON(needs) }}; | |
checkJobsForErrors({ core, jobs }); |