git.iko.soy/typeable/oauth2-proxy
on master help sign in
Docs: Add Search (#2228)
225dc92Jan Larwig
.github/workflows/docs.yaml+47−46
@@ -9,63 +9,64 @@ on:
9 paths: ['docs/**']
9 paths: ['docs/**']
10
10
11jobs:
11jobs:
12− checks:
12+ pull-request-check:
13− if: github.event_name != 'push'
13+ if: github.event_name == 'pull_request'
14 runs-on: ubuntu-latest
14 runs-on: ubuntu-latest
15 steps:
15 steps:
16− - uses: actions/checkout@v3
16+ - uses: actions/checkout@v4
17+
17− - uses: actions/setup-node@v1
18+ - uses: actions/setup-node@v3
18 with:
19 with:
19− node-version: '17.x'
20+ node-version: 18
21+
20 - name: Test Build
22 - name: Test Build
21 working-directory: ./docs
23 working-directory: ./docs
22− env:
23− NODE_OPTIONS: --openssl-legacy-provider
24 run: |
24 run: |
25− if [ -e yarn.lock ]; then
26− yarn install --frozen-lockfile
27− elif [ -e package-lock.json ]; then
28 npm ci
25 npm ci
29− else
30− npm i
31− fi
32 npm run build
26 npm run build
27+
33− gh-release:
28+ gh-pages-release:
34− if: github.event_name != 'pull_request'
29+ if: github.event_name == 'push'
35 runs-on: ubuntu-latest
30 runs-on: ubuntu-latest
31+ permissions:
32+ contents: write
36 steps:
33 steps:
37− - uses: actions/checkout@v3
34+ - uses: actions/checkout@v4
38− - uses: actions/setup-node@v1
39 with:
35 with:
36+ path: master
37+
38+ - uses: actions/checkout@v4
39+ with:
40+ ref: gh-pages
41+ path: gh-pages
42+
43+ - uses: actions/setup-node@v3
44+ with:
40− node-version: '17.x'
45+ node-version: 18
41− - name: Add key to allow access to repository
46+
42− env:
47+ - name: Build docusaurus
43− SSH_AUTH_SOCK: /tmp/ssh_agent.sock
48+ working-directory: master/docs
44− NODE_OPTIONS: --openssl-legacy-provider
49+ id: build
45 run: |
50 run: |
46− mkdir -p ~/.ssh
51+ echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
47− ssh-keyscan github.com >> ~/.ssh/known_hosts
52+ npm ci
48− echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
53+ npm run build
49− chmod 600 ~/.ssh/id_rsa
54+
50− cat <<EOT >> ~/.ssh/config
51− Host github.com
52− HostName github.com
53− IdentityFile ~/.ssh/id_rsa
54− EOT
55− - name: Release to GitHub Pages
55+ - name: Release to github pages
56− working-directory: ./docs
57 env:
56 env:
58− USE_SSH: true
57+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59− GIT_USER: git
58+ working-directory: gh-pages
60− NODE_OPTIONS: --openssl-legacy-provider
61 run: |
59 run: |
62− git config --global user.email "actions@gihub.com"
60+ git config --local user.name "github-actions[bot]"
63− git config --global user.name "gh-actions"
61+ git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
64− if [ -e yarn.lock ]; then
62+
65− yarn install --frozen-lockfile
63+ # Remove all files except .git
66− elif [ -e package-lock.json ]; then
64+ git rm -r *
67− npm ci
65+
68− else
66+ # Copy the build files from master/docs/build to gh-pages
69− npm i
67+ cp -r ../master/docs/build/* .
70− fi
68+
71− npx docusaurus deploy
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
docs/docusaurus.config.js+9
@@ -54,4 +54,13 @@ module.exports = {
54 },
54 },
55 ],
55 ],
56 ],
56 ],
57+ themes: [
58+ [
59+ require.resolve("@easyops-cn/docusaurus-search-local"),
60+ /** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
61+ ({
62+ hashed: true,
63+ }),
64+ ],
65+ ],
57};
66};
docs/package-lock.json+7214−7039

This diff is too big to show here.

docs/package.json+2

This diff is too big to show here.