Skip to content

Group schedule (#418) #352

Group schedule (#418)

Group schedule (#418) #352

Workflow file for this run

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: '0.135.0'
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 }}