-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (45 loc) · 1.27 KB
/
build-and-deploy.yml
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
name: Static site build
on:
workflow_dispatch:
workflow_run:
workflows: ['Fetch data']
types: [completed]
jobs:
exit:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Exit on fetch failure
run: |
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Get build date
id: date-get
run: |
echo "BUILD_DATE=$(TZ=America/New_York date +%Y-%m-%d)" >> $GITHUB_ENV
- name: Print build date
id: date-print
run: |
echo ${{ env.BUILD_DATE }} >> .last-updated
- name: Build
run: |
npm ci
npm run build
touch dist/.nojekyll
echo "216.show" >> dist/CNAME
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.4.3
with:
branch: gh-pages
folder: dist