Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Commit 4673c13

Browse files
committed
Workflow assign write permissions and add deploy job
1 parent da76681 commit 4673c13

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

.github/workflows/build-docs.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: ["main"]
66
workflow_dispatch:
77

8+
permissions:
9+
id-token: write
10+
pages: write
11+
812
env:
913
INSTANCE: 'Writerside/ch'
1014
DOCKER_VERSION: '243.21565'
@@ -56,4 +60,45 @@ jobs:
5660
artifacts/${{ env.ARTIFACT }}
5761
artifacts/report.json
5862
artifacts/${{ env.ALGOLIA_ARTIFACT }}
59-
retention-days: 7
63+
retention-days: 7
64+
test:
65+
needs: build
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Download artifacts
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: docs
72+
path: artifacts
73+
74+
- name: Test documentation
75+
uses: JetBrains/writerside-checker-action@v1
76+
with:
77+
instance: ${{ env.INSTANCE }}
78+
deploy:
79+
environment:
80+
name: github-pages
81+
url: ${{ steps.deployment.outputs.page_url }}
82+
needs: [build, test]
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Download artifacts
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: docs
89+
path: artifacts
90+
91+
- name: Unzip artifact
92+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d dir
93+
94+
- name: Setup Pages
95+
uses: actions/configure-pages@v4
96+
97+
- name: Package and upload Pages artifact
98+
uses: actions/upload-pages-artifact@v3
99+
with:
100+
path: dir
101+
102+
- name: Deploy to GitHub Pages
103+
id: deployment
104+
uses: actions/deploy-pages@v4

Writerside/writerside.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
<ihp version="2.0">
55
<topics dir="topics" web-path="topics"/>
6-
<images dir="images" web-path="images"/>
6+
<images dir="images" web-path="ctf-handbooks.github.io"/>
77
<instance src="ch.tree" web-path="/ch/"/>
88
</ihp>

0 commit comments

Comments
 (0)