-
Notifications
You must be signed in to change notification settings - Fork 61
60 lines (58 loc) · 1.93 KB
/
push-doc.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
name: "Push RTD on gh-pages"
on:
push:
branches:
- master
- dev
schedule:
# * is a special character in YAML
# setup monthly background build
- cron: '45 4 20 * *'
# gh-pages have a lifetime ? 90 days ? so we do this once a month to refresh
jobs:
docs:
runs-on: ubuntu-latest
env:
sphinx_html_baseurl: 'https://spinalhdl.github.io/SpinalDoc-RTD/master/'
sphinx_github_url: 'https://github.com/SpinalHDL/SpinalDoc-RTD'
sphinx_extra_version: 'master'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build docker image
uses: docker/build-push-action@v3
with:
context: .
load: true
push: false
cache-to: type=gha
cache-from: type=gha
tags: spinaldoc-pdf
file: pdf.Dockerfile
- name: Check links
run: docker run --rm -u $(id -u $USER):$(id -g $USER) -v $PWD:/docs -e sphinx_html_baseurl -e sphinx_github_url spinaldoc-pdf make linkcheck
- name: Build multiversioned doc
run: docker run --rm -u $(id -u $USER):$(id -g $USER) -v $PWD:/docs -e sphinx_html_baseurl -e sphinx_github_url spinaldoc-pdf sphinx-multiversion source docs/html
- name: Add .nojekill
run: sudo touch docs/html/.nojekyll
- name: Add redirection to master
run: |
sudo tee docs/html/index.html << EOF
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to ${sphinx_extra_version}</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./${sphinx_extra_version}/index.html">
<link rel="canonical" href="${sphinx_html_baseurl}index.html">
</head>
</html>
EOF
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/html