-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 2.14 KB
/
deploy-website-production.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 });