-
-
Notifications
You must be signed in to change notification settings - Fork 63
79 lines (67 loc) · 2.57 KB
/
doc.yml
File metadata and controls
79 lines (67 loc) · 2.57 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
name: Build Documentation
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "docs/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'docs/**'
jobs:
build:
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
id: build_hugo
run: |
cd docs
sed -i "s/canonifyURLs = true/canonifyURLs = false/g" hugo.toml
export BRANCH_NAME=$(echo ${GITHUB_REF_NAME} | tr / -)
echo "BRANCH_NAME=${BRANCH_NAME}" >> "$GITHUB_ENV"
echo "branch_name=${BRANCH_NAME}" >> "$GITHUB_OUTPUT"
hugo --minify --baseURL https://${BRANCH_NAME}.resticprofile.pages.dev/
- name: Check broken links
uses: ruzickap/action-my-broken-link-checker@v3
with:
url: "https://${{ steps.build_hugo.outputs.branch_name }}.resticprofile.pages.dev/"
pages_path: ./public/
cmd_params: '--exclude="(linux\.die\.net|scoop\.sh|stackoverflow\.com|commit)" --buffer-size=8192 --max-connections-per-host=8 --rate-limit=20 --color=always --skip-tls-verification --header="User-Agent: Muffet/2.10.8" --timeout=20'
- name: Publish to pages.dev
continue-on-error: true # secrets are not set for PRs from forks
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=${{ github.ref_name }}