-
Notifications
You must be signed in to change notification settings - Fork 33
76 lines (63 loc) · 2.32 KB
/
release-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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Documentation Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ~1.23
- name: Check configuration snippets in documentation
run: go run ./config/checkdoc -r docs/content
shell: bash
- name: Build JSON schema & config reference
run: make generate-jsonschema generate-config-reference
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build for GitHub Pages
run: cd docs && hugo --minify --baseURL https://creativeprojects.github.io/resticprofile/
- name: Prepare for broken link check
run: |
mkdir -p ./www
cp -r ./public ./www/resticprofile
- name: Check broken links
uses: ruzickap/action-my-broken-link-checker@v2
with:
url: https://creativeprojects.github.io/resticprofile/
pages_path: ./www/
cmd_params: '--exclude="(linux.die.net|stackoverflow.com)" --buffer-size=8192 --max-connections-per-host=5 --rate-limit=5 --timeout=20 --header="User-Agent:curl/7.54.0" --skip-tls-verification'
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
# if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-docs
publish_dir: ./public
- name: Build for pages.dev
run: |
cd docs
sed -i "s/canonifyURLs = true/canonifyURLs = false/g" hugo.toml
hugo --minify --baseURL https://resticprofile.creativeprojects.tech/
- name: Publish to pages.dev
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: 'resticprofile'
directory: 'public'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main