-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (74 loc) · 1.96 KB
/
new_release.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
# create a release and deploy the pdf to GitHub Pages
name: New Release
on:
push:
tags:
- v*.*.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: "*.tex"
glob_root_file: true
- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: PDF
path: "*.pdf"
release:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download build
uses: actions/download-artifact@v3
with:
name: PDF
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
*.pdf
publish:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Create build destination
run: |
mkdir public
cat > public/index.html <<EOL
<!doctype html>
<html>
<head>
<title>GitHub Pages deployed!</title>
</head>
<body>
<div style="position: absolute; left: 0; right: 0; bottom: 0; top: 0;">
<iframe src="./main.pdf" width="100%" height="100%" frameborder="0">
</iframe>
</div>
</body>
</html>
EOL
- name: Download build
uses: actions/download-artifact@v3
with:
name: PDF
path: public
- name: View downloaded artifacts
run: ls -R
working-directory: public
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}