-
Notifications
You must be signed in to change notification settings - Fork 6
149 lines (127 loc) · 5.01 KB
/
Copy pathdeploy.yml
File metadata and controls
149 lines (127 loc) · 5.01 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build and deploy site
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: read
concurrency:
group: github-pages
cancel-in-progress: false
jobs:
build:
name: Build and validate
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Setup Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3.5"
bundler-cache: true
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"
cache: pip
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "20"
cache: npm
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install --yes imagemagick poppler-utils
- name: Install Python dependencies
run: python -m pip install --requirement requirements.txt
- name: Install JavaScript dependencies
run: npm ci
- name: Synchronize and validate the public repository catalog
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
ruby bin/sync_repository_catalog.rb
ruby bin/validate_repository_catalog.rb
- name: Render the English, Chinese, and Japanese CVs
shell: bash
run: |
rm -f assets/rendercv/rendercv_output/*
rendercv render _data/cv.yml \
--settings assets/rendercv/settings.yaml \
--design assets/rendercv/design.yaml \
--locale-catalog assets/rendercv/locale.yaml \
--quiet
rendercv render _data/cv_zh_cn.yml \
--settings assets/rendercv/settings_zh_cn.yaml \
--design assets/rendercv/design_zh_cn.yaml \
--locale-catalog assets/rendercv/locale_zh_cn.yaml \
--quiet
rendercv render _data/cv_ja.yml \
--settings assets/rendercv/settings_ja.yaml \
--design assets/rendercv/design_ja.yaml \
--locale-catalog assets/rendercv/locale_ja.yaml \
--quiet
install -D -m 0644 assets/rendercv/rendercv_output/Weiping_Yan_CV_en.pdf assets/pdf/Weiping_Yan_CV_en.pdf
install -D -m 0644 assets/rendercv/rendercv_output/Weiping_Yan_CV_zh-CN.pdf assets/pdf/Weiping_Yan_CV_zh-CN.pdf
install -D -m 0644 assets/rendercv/rendercv_output/Weiping_Yan_CV_ja.pdf assets/pdf/Weiping_Yan_CV_ja.pdf
install -D -m 0644 assets/rendercv/rendercv_output/Weiping_Yan_CV_en.pdf assets/pdf/Weiping_Yan_CV.pdf
test -s assets/pdf/Weiping_Yan_CV_en.pdf
test -s assets/pdf/Weiping_Yan_CV_zh-CN.pdf
test -s assets/pdf/Weiping_Yan_CV_ja.pdf
cmp --silent assets/pdf/Weiping_Yan_CV_en.pdf assets/pdf/Weiping_Yan_CV.pdf
python bin/validate_cv_pdfs.py
rm -f assets/rendercv/rendercv_output/*
- name: Check formatting and starter contracts
run: |
npm run lint:prettier
npm run lint:style-contract
npm run test:translations
npm run test:redirects
npm run test:catalog-policy
npm run test:covers
- name: Audit the al-folio upgrade boundary
run: |
bundle exec al-folio upgrade audit --no-fail
bundle exec al-folio upgrade overrides audit --fail-on-stale
- name: Build the production site
env:
JEKYLL_ENV: production
run: bundle exec jekyll build
- name: Generate legacy redirects
run: ruby bin/generate_legacy_redirects.rb --destination _site
- name: Purge unused CSS
run: npm run build:purge-css
- name: Validate the published output
run: |
ruby bin/validate_repository_catalog.rb --offline
bundle exec ruby bin/validate_production_site.rb --destination _site
- name: Configure GitHub Pages
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload GitHub Pages artifact
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: _site
deploy:
name: Deploy
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0