Skip to content

Commit 99033c2

Browse files
committed
Publish to GitHub Pages
1 parent 27f5543 commit 99033c2

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
pull_request:
44
push:
55
branches:
6-
- main
6+
- '*'
77
tags:
88
- v*
99

@@ -51,3 +51,46 @@ jobs:
5151
name: pdf
5252
path: _build/latex/*.pdf
5353
retention-days: 14
54+
55+
publish:
56+
runs-on: ubuntu-latest
57+
name: Publish to GitHub pages
58+
needs: build-html-man-pdf
59+
environment: github-pages
60+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
61+
permissions:
62+
pages: write
63+
id-token: write
64+
steps:
65+
66+
- uses: actions/checkout@v2
67+
68+
- name: Prepare site (pre-rendered)
69+
run: |
70+
git clone --depth 1 https://github.com/syncthing/docs-pre-rendered.git _site
71+
rm -rf _site/.git
72+
go run _script/lsver.go _site > _site/versions.json
73+
74+
- name: Prepare site (html)
75+
uses: actions/download-artifact@v2
76+
with:
77+
name: html
78+
path: _site
79+
80+
- name: Prepare site (man)
81+
uses: actions/download-artifact@v2
82+
with:
83+
name: man
84+
path: _site/man
85+
86+
- name: Prepare site (pdf)
87+
uses: actions/download-artifact@v2
88+
with:
89+
name: man
90+
path: _site/man
91+
92+
- name: Upload Pages artifact
93+
uses: actions/upload-pages-artifact@v2
94+
95+
- name: Deploy to GitHub Pages
96+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)