-
Notifications
You must be signed in to change notification settings - Fork 28
131 lines (113 loc) · 3.38 KB
/
ci.yml
File metadata and controls
131 lines (113 loc) · 3.38 KB
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
130
131
name: CI
on:
push:
schedule:
- cron: '42 1 * * *' # run at 1:42 AM every day
jobs:
build-publish:
name: Build and Publish
runs-on: ubuntu-24.04
steps:
- name: Main checkout (source)
uses: actions/checkout@v2
with:
path: main
- name: Build Action
uses: ./main/.github/actions/build-site
- name: Check out destination (HTML) branch
uses: actions/checkout@v2
if: env.PUBLISH_BRANCH
with:
ref: ${{ env.PUBLISH_BRANCH }}
path: output
- name: Publish site
if: env.PUBLISH_BRANCH
env:
PUB_BRANCH: ${{ env.PUBLISH_BRANCH }}
PUB_DEST_DIR: docs
PUB_COMMIT_MSG: ${{ github.event.head_commit.message }}
run: main/_scripts/publish-github.sh
- name: Tar site
run: tar czf site.tar.gz _site && du -k site.tar.gz
- name: Upload site artifact
uses: actions/upload-artifact@v4
with:
name: site
path: site.tar.gz
screenshots:
name: Take Screenshots
runs-on: ubuntu-24.04
needs: build-publish
if: |
github.event_name == 'push' &&
! startsWith(github.ref, 'refs/heads/staticman_')
strategy:
fail-fast: false
matrix:
width: [414, 1200]
color-pref: [light, dark]
steps:
- name: Main checkout (source)
uses: actions/checkout@v2
with:
path: main
- uses: rlespinasse/github-slug-action@3.5.1
- uses: actions/download-artifact@v4
with:
name: site
- name: Untar site
run: |
tar xf site.tar.gz
- name: Take and publish screenshots
env:
SNAPSHOT_REPO: https://github.com/travisdowns/blog-screenshots
SNAPSHOT_DEST_PATH: ${{ matrix.color-pref }}-${{ matrix.width }}px
SNAPSHOT_BRANCH: ${{ env.GITHUB_REF_SLUG }}
SNAPSHOT_USER: ${{ github.actor }}
SNAPSHOT_EMAIL: ${{ github.actor }}@users.noreply.github.com
SNAPSHOT_REPO_AUTH: ${{ secrets.SNAPSHOT_REPO_AUTH }}
SNAPSHOT_EXCLUDES: '**/debug-pages.html,misc/tables/intel-zero-opt/**'
SNAPSHOT_WIDTH: ${{ matrix.width }}
SNAPSHOT_COLOR_PREF: ${{ matrix.color-pref }}
SNAPSHOT_COMMIT_MSG: >
[screenshot SNAPSHOT_MOD_TAG mod, SNAPSHOT_NEW_TAG new,
SNAPSHOT_COLOR_PREF_TAG-SNAPSHOT_WIDTH_TAGpx]
${{ github.actor }}: ${{ github.event.head_commit.message }}
run: main/_scripts/snapshot.sh
checks:
name: ${{ matrix.script.name }}
runs-on: ubuntu-24.04
needs: build-publish
env:
SRC: main
SITE: _site
strategy:
fail-fast: false
matrix:
script:
- path: internal-links.sh
name: Internal Links
- path: external-links.sh
name: External Links
- path: validate-html.sh
name: Check HTML
- path: misc.sh
name: Miscellaneous
no-html-proofer: true
steps:
- name: Main checkout (source)
uses: actions/checkout@v2
with:
path: main
- uses: actions/download-artifact@v4
with:
name: site
- name: Untar site
run: |
tar xf site.tar.gz
- name: Install htmlproofer
if: ${{ ! matrix.script.no-html-proofer }}
run: |
sudo gem install html-proofer -v 3.19.4 --no-document
- name: Run ${{ matrix.script.path }}
run: main/_scripts/checks/${{ matrix.script.path }}