-
Notifications
You must be signed in to change notification settings - Fork 25
249 lines (210 loc) · 6.07 KB
/
build.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: Build and deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build-linux:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16]
go: ['1.18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
# Currently build is only made for gh-pages, this is not necessary.
# - name: npm install and build
# run: |
# npm install
# npm run build
# - uses: actions/upload-artifact@v2
# with:
# name: web-build
# path: build/
- name: npm install and build with spa-github-pages
run: |
cp spa-github-pages/index.html public/index.html
npm install --global yarn
yarn install
yarn run build
cp spa-github-pages/404.html build/
- uses: actions/upload-artifact@v3
with:
name: web-build-gh-pages
path: build/
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Generate TeX file for resume
run: |
cd resume
go run main.go
- uses: actions/upload-artifact@v3
with:
name: resume-tex-ubuntu
path: ./resume/resume/
build-macos:
strategy:
matrix:
os: [macos-latest]
node-version: [16]
go: ['1.18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
# No need to build here, all that is needed is profile_resume.json.
- name: npm install and build
run: |
npm install --global yarn
yarn install
yarn run build
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Generate TeX file for resume
run: |
cd resume
go run main.go
- uses: actions/upload-artifact@v3
with:
name: resume-tex-macos
path: ./resume/resume/
build-resume-linux:
needs: [build-linux]
runs-on: ubuntu-latest
steps:
- name: Download TeX files
uses: actions/download-artifact@v3
with:
name: resume-tex-ubuntu
- name: TeX to pdf on Linux
uses: xu-cheng/latex-action@v2
with:
root_file: ./resume.tex
latexmk_use_xelatex: true
- uses: actions/upload-artifact@v3
with:
name: resume-ubuntu
path: ./*
build-resume-macos:
needs: [build-linux, build-macos]
runs-on: macos-latest
steps:
- name: Download TeX files
uses: actions/download-artifact@v3
with:
name: resume-tex-macos
- name: Build TeX files
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap homebrew/cask
brew install --cask mactex-no-gui
eval "$(/usr/libexec/path_helper)"
xelatex resume.tex
- uses: actions/upload-artifact@v3
with:
name: resume-macos
path: ./*
deploy-from-linux-build:
needs: [build-resume-linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Update branch deployment_platforms with main
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: deployment_platforms
FOLDER: .
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Prepare gh-pages
run: |
mkdir -p gh-pages
cp -r web-build-gh-pages/* gh-pages/
mkdir -p gh-pages/files/resume
cp -r resume-ubuntu/* gh-pages/files/resume/
- name: Push to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: gh-pages
- name: Update _profile of deployment_platforms branch with resume
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: deployment_platforms
FOLDER: resume-ubuntu
TARGET_FOLDER: _profile/files/resume
deploy-from-macos-build:
needs: [build-resume-macos]
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Prepare gh-pages-mac
run: |
mkdir -p gh-pages-mac
cp -r web-build-gh-pages/* gh-pages-mac/
mkdir -p gh-pages-mac/files/resume
cp -r resume-macos/* gh-pages-mac/files/resume/
- name: Push to gh-pages-mac
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages-mac
FOLDER: gh-pages-mac
- name: Update _profile of deployment_platforms branch with resume
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: deployment_platforms
FOLDER: resume-macos
TARGET_FOLDER: _profile/files/resume
build-all:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [16]
go: ['1.18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: npm install and build
run: |
npm install --global yarn
yarn install
yarn run build
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Generate TeX file for resume
run: |
cd resume
go run main.go