Skip to content

Publish docs

Publish docs #19

Workflow file for this run

name: Publish docs
on:
workflow_dispatch: ~
jobs:
docs:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
repository: scalableminds/webknossos
path: docs/wk-repo
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
# Install a specific version of uv.
version: "0.4.19"
- name: Build Docs
run: |
cd docs
./generate.sh --persist
- name: Push docs
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "eu-west-1"
run: |
CI_BRANCH=${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}
NORMALIZED_CI_BRANCH=${CI_BRANCH//[\/-]/_}
aws s3 sync --acl public-read docs/out s3://static.webknossos.org/docs/${NORMALIZED_CI_BRANCH}
- name: Check links (on master)
env:
SLACK_HOOK: ${{ secrets.LINK_CHECKER_SLACK_HOOK }}
run: |
cd docs
uv run --frozen linkchecker --config linkcheckerrc https://docs.webknossos.org > link_status || \
curl -X POST --data-urlencode "payload={\"text\": \":warning: Broken Links on doc.webknossos.org :warning:\n"'```'"\n$(cat link_status)\n"'```"}' \
"$SLACK_HOOK"