-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (105 loc) · 3.74 KB
/
ci.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI/CD
on:
push:
schedule:
- cron: 0 0 * * *
jobs:
events:
name: Events
runs-on: ubuntu-latest
defaults:
run:
working-directory: events
timeout-minutes: 20
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install dependencies
run: npm install
- name: Fetch events
run: node app.js
env:
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
- name: Store events artifact
uses: actions/upload-artifact@v4
with:
name: events
path: events/output.html
- name: Health check
if: always()
uses: ./.github/actions/healthchecks
with:
status: ${{ job.status }}
url: ${{ secrets.HEALTH_CHECK_URL__NIGHTLY_EVENTS }}
build:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 20
needs:
- events
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: GitHub Package Registry login
run: echo ${{ secrets.GITHUB_PACKAGE_REGISTRY_TOKEN }} | docker login --username=tedmiston --password-stdin docker.pkg.github.com
- name: GitHub Package Registry pull
run: >
docker pull docker.pkg.github.com/tedmiston/qcbrunch/hadolint:2d6321a68ac110d14283b89be69e57a9f3b2e616 &&
docker pull docker.pkg.github.com/tedmiston/qcbrunch/html-validator:2d6321a68ac110d14283b89be69e57a9f3b2e616 &&
docker pull docker.pkg.github.com/tedmiston/qcbrunch/js-validator:2d6321a68ac110d14283b89be69e57a9f3b2e616
- name: Validate Dockerfiles
uses: ./.github/actions/hadolint
- name: Load events artifact
uses: actions/download-artifact@v4
with:
name: events
path: /home/runner/work/qcbrunch/qcbrunch/events
- name: Build site
uses: docker://python:3.8.13-slim@sha256:726098870bb14355cb12572764a3be191b42f8b15947d97affe3b8ec6a7a446e
env:
QCBRUNCH_ROOT: $GITHUB_WORKSPACE
with:
entrypoint: bash
args: -c ./docker/qcbrunch-cli/app.sh
- name: Validate HTML
uses: ./.github/actions/html-validator
# todo: debug why image isn't pull stopped working
# - name: Validate CSS
# uses: docker://validator/validator:latest@sha256:33dd5741e96e2369398046fbdce3111d08e3b15e7fc12235655667eacc5d67d3
# with:
# args: /vnu-runtime-image/bin/vnu --skip-non-css --verbose build/css/
- name: Validate JS
uses: ./.github/actions/js-validator
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Validate Markdown
run: >
sudo npm install -g markdownlint-cli &&
markdownlint --ignore=_posts/ --ignore=node_modules/ .
- name: Install Vercel
run: sudo rm /usr/local/bin/vercel && sudo npm install --location=global vercel --unsafe-perm=true --allow-root
- name: Deploy Dev
# if: github.ref != 'refs/heads/master' || github.event_name == 'schedule'
run: make deploy-dev
env:
ZEIT_TOKEN: ${{ secrets.ZEIT_TOKEN }}
- name: Deploy Prod
if: github.ref == 'refs/heads/master' || github.event_name == 'schedule'
run: make deploy-prod
env:
ZEIT_TOKEN: ${{ secrets.ZEIT_TOKEN }}
- name: GitHub Package Registry logout
if: always()
run: docker logout docker.pkg.github.com
- name: Health check
if: always()
uses: ./.github/actions/healthchecks
with:
status: ${{ job.status }}
url: ${{ secrets.HEALTH_CHECK_URL__NIGHTLY_BUILD }}