docs: upgrade theme and add GA for testing #356
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation Build | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "docs/**" | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'docs/**' | |
jobs: | |
build: | |
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 | |
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" | |
hugo --minify --baseURL https://${BRANCH_NAME}.resticprofile.pages.dev/ | |
- name: Check broken links | |
uses: ruzickap/action-my-broken-link-checker@v2 | |
with: | |
url: "https://${{ env.BRANCH_NAME }}.resticprofile.pages.dev/" | |
pages_path: ./public/ | |
cmd_params: '--exclude="(linux.die.net|stackoverflow.com)" --buffer-size=8192 --max-connections=10 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0" --timeout=20' | |
- name: Publish to pages.dev | |
continue-on-error: true # secrets are not set for PRs from forks | |
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: ${{ github.ref_name }} |