-
Notifications
You must be signed in to change notification settings - Fork 615
110 lines (101 loc) · 2.78 KB
/
build-deploy-assets.yaml
File metadata and controls
110 lines (101 loc) · 2.78 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
name: build-deploy-assets
on:
push:
branches: [ master ]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: build-deploy-assets-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-24.04
container: twtug/lkmpg
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Cache TeX intermediates
uses: actions/cache@v5
with:
path: |
lkmpg.aux
lkmpg.fdb_latexmk
lkmpg.fls
lkmpg.out
lkmpg-for-ht.tmp
key: docs-build-${{ runner.os }}-${{ hashFiles('lkmpg.tex', 'Makefile', 'html.cfg', 'lib/**/*.tex', 'examples/**/*', 'assets/**/*') }}
- name: Build PDF and HTML
run: |
make all 2>&1 | tee build-pdf.log
make html 2>&1 | tee build-html.log
tar zcvf lkmpg-html.tar.gz ./html
- name: Upload release payload
uses: actions/upload-artifact@v7
with:
name: release-assets
path: |
lkmpg.pdf
lkmpg-html.tar.gz
- name: Upload HTML artifact
uses: actions/upload-artifact@v7
with:
name: html-site
path: html
- name: Upload diagnostics
if: failure()
uses: actions/upload-artifact@v7
with:
name: docs-build-logs
path: |
build-pdf.log
build-html.log
if-no-files-found: ignore
release:
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download release payload
uses: actions/download-artifact@v8
with:
name: release-assets
- name: Update latest tag
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -fa latest -m "Latest generated assets"
git push origin refs/tags/latest --force
- name: Publish release
uses: softprops/action-gh-release@v3
with:
files: |
lkmpg.pdf
lkmpg-html.tar.gz
tag_name: "latest"
prerelease: true
overwrite_files: true
deploy-pages:
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Download HTML artifact
uses: actions/download-artifact@v8
with:
name: html-site
path: html
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: html
publish_branch: gh-pages