-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.48 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
name: Build bundle and generate PDFs
# Build is done for all pushes except the master branch.
# In master, this workflow is called through deploy.yml
on:
push:
branches-ignore: [master]
workflow_call:
# Allow one concurrent build for each branch
concurrency:
group: build-pages-${{ github.ref }}
cancel-in-progress: true
env:
PDF_OPTIONS: |
{"format": "A4"}
jobs:
build:
runs-on: ubuntu-latest
# Read-only permissions for GITHUB_TOKEN
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build the app
env:
VITE_GITHUB_REPO: ${{ github.repository }}
run: npm run build
- name: Serve the app
run: npm run preview -- --host & npx wait-on tcp:4173
- name: Generate PDF file (en)
uses: ntdesmond/html2pdf-action@v1
with:
path: http://172.17.0.1:4173/cv.html?language=en
output: ./build/cv_en.pdf
options: ${{ env.PDF_OPTIONS }}
- name: Generate PDF file (ru)
uses: ntdesmond/html2pdf-action@v1
with:
path: http://172.17.0.1:4173/cv.html?language=ru
output: ./build/cv_ru.pdf
options: ${{ env.PDF_OPTIONS }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "build/"