-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.33 KB
/
build-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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Compile and Publish Resume
on:
release:
types: published
env:
resume-file: ccjmne-resume.pdf
artifact-id: ccjmne-resume
jobs:
build:
runs-on: ubuntu-latest
env:
node-version: 16.x
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: npm
cache-dependency-path: package-lock.json
- name: Webpack build
run: |
npm install
npx webpack --mode production
- name: Upload resume artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact-id }}
path: dist/${{ env.resume-file }}
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download resume artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.artifact-id }}
- name: Create minimalistic index.html
run: |
cat << EOF > index.html
<meta http-equiv="refresh" content="0; URL=./${{ env.resume-file }}">
EOF
- name: Compute short SHA
run: echo SHORT_SHA=`echo ${GITHUB_SHA::7}` >> $GITHUB_ENV
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: .
github_token: ${{ secrets.GITHUB_TOKEN }}
full_commit_message: Redeploy for ${{ env.SHORT_SHA }}