-
Notifications
You must be signed in to change notification settings - Fork 14
47 lines (41 loc) · 1.58 KB
/
publish_docs.yml
File metadata and controls
47 lines (41 loc) · 1.58 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
name: Publish docs
on:
workflow_dispatch: ~
jobs:
docs:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/checkout@v6
with:
repository: scalableminds/webknossos
path: docs/wk-repo
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
- 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 }}
N8N_TOKEN: ${{ secrets.N8N_USERNAME }}
N8N_USERNAME: ${{ secrets.N8N_TOKEN }}
run: |
CI_BRANCH=${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}
NORMALIZED_CI_BRANCH=${CI_BRANCH//[\/-]/_}
set -e
uvx --from awscli aws s3 cp --recursive --endpoint-url https://hel1.your-objectstorage.com docs/out s3://webknossos-www/docs/${NORMALIZED_CI_BRANCH}
curl --basic -u "${N8N_TOKEN}:${N8N_USERNAME}" https://docs.webknossos.org/webhooks/index-docs
- 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 docs.webknossos.org :warning:\n"'```'"\n$(cat link_status)\n"'```"}' \
"$SLACK_HOOK"