git.iko.soy/typeable/oauth2-proxy
on 600f577 help sign in
72 lines 1.7 kB history raw
1name: documentation
3on:
4 pull_request:
5 branches: [master]
6 paths: ['docs/**']
7 push:
8 branches: [master]
9 paths: ['docs/**']
11jobs:
12 pull-request-check:
13 if: github.event_name == 'pull_request'
14 runs-on: ubuntu-latest
15 steps:
16 - uses: actions/checkout@v4
18 - uses: actions/setup-node@v3
19 with:
20 node-version: 18
22 - name: Test Build
23 working-directory: ./docs
24 run: |
25 npm ci
26 npm run build
28 gh-pages-release:
29 if: github.event_name == 'push'
30 runs-on: ubuntu-latest
31 permissions:
32 contents: write
33 steps:
34 - uses: actions/checkout@v4
35 with:
36 path: master
38 - uses: actions/checkout@v4
39 with:
40 ref: gh-pages
41 path: gh-pages
43 - uses: actions/setup-node@v3
44 with:
45 node-version: 18
47 - name: Build docusaurus
48 working-directory: master/docs
49 id: build
50 run: |
51 echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
52 npm ci
53 npm run build
55 - name: Release to github pages
56 env:
57 GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 working-directory: gh-pages
59 run: |
60 git config --local user.name "github-actions[bot]"
61 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
63 # Remove all files except .git
64 git rm -r *
66 # Copy the build files from master/docs/build to gh-pages
67 cp -r ../master/docs/build/* .
69 # Commit and push
70 git add .
71 git commit -m "Update documentation based on ${{ steps.build.outputs.sha }}"
72 git push origin gh-pages