-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (107 loc) · 2.97 KB
/
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
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: Deploy to GitHub Pages
on:
push:
branches:
- 'main'
- feat/latex-resume-export
jobs:
compile-latex:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm install
- name: Compile latex
run: |
node scripts/1.compile-latex-template.js
- name: Cache LaTeX files
uses: actions/cache@v4
with:
path: ./tex
key: tex
export-latex-to-pdf:
needs: compile-latex
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Docker
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build -t texlive-extended .
working-directory: ./tex
- name: Cache LaTeX files
uses: actions/cache@v4
with:
path: ./tex
key: tex
- name: Run Docker container
run: |
docker run --rm \
--volume `pwd`/tex:/work/src:ro \
--volume `pwd`/tex/out:/work/out \
-e TEXLIVE_REPOSITORY='https://sg.mirrors.cicku.me/ctan/systems/texlive/tlnet' \
texlive-extended:latest \
work lualatex WongZhaoWu-resume.tex
- name: Copy PDF to static
run: |
cp tex/out/WongZhaoWu-resume.pdf \
./static/WongZhaoWu-resume.pdf
- name: Cache Static files
uses: actions/cache@v4
with:
path: ./static
key: static
build-site:
needs: export-latex-to-pdf
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# If you're using pnpm, add this step then change the commands and cache key below to use `pnpm`
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# with:
# version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm install
- run: ls -la node_modules
- name: Cache Static files
uses: actions/cache@v4
with:
path: ./static
key: static
- name: build
env:
BASE_PATH: '/${{ github.event.repository.name }}'
run: |
npm run build
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v2
with:
# this should match the `pages` option in your adapter-static options
path: 'build/'
deploy:
needs: build-site
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v2