-
-
Notifications
You must be signed in to change notification settings - Fork 65
83 lines (69 loc) · 2.64 KB
/
Copy pathrelease-doc.yml
File metadata and controls
83 lines (69 loc) · 2.64 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
name: Documentation Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@v1
with:
path: .github/workflows/env
log-variables: true
- name: Set up Go ${{ steps.dotenv.outputs.go_version }}
uses: actions/setup-go@v6
with:
go-version: ${{ steps.dotenv.outputs.go_version }}
check-latest: true
cache: true
- name: Check configuration snippets in documentation
run: go run ./config/checkdoc -r docs/content -i changelog.md
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: '0.150.1'
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@v3
with:
url: https://creativeprojects.github.io/resticprofile/
pages_path: ./www/
cmd_params: '--exclude="(linux\.die\.net|scoop\.sh|stackoverflow\.com|commit)" --buffer-size=8192 --max-connections-per-host=8 --rate-limit=20 --timeout=20 --header="User-Agent: Muffet/2.10.8" --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/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
command: pages deploy public --project-name=resticprofile --branch=main