git.iko.soy/typeable/oauth2-proxy
on master help sign in
Docs: Add Search (#2228)

* add search and update depedencies * refactor documentation workflow to follow best github action best practices

commit225dc92adf09c03f7414e260b5a7c29fd371f035 authorJan Larwig <jan@larwig.com> dateWed 13 Sep 2023, 13:00 (3 years ago) parent854401e
4 files changed+7272−7085
.github/workflows/docs.yaml+47−46 docs/docusaurus.config.js+9 docs/package-lock.json+7214−7039 docs/package.json+2
.github/workflows/docs.yaml+47−46
@@ -9,63 +9,64 @@ on:
99 paths: ['docs/**']
1010
1111jobs:
12− checks:
13− if: github.event_name != 'push'
12+ pull-request-check:
13+ if: github.event_name == 'pull_request'
1414 runs-on: ubuntu-latest
1515 steps:
16− - uses: actions/checkout@v3
17− - uses: actions/setup-node@v1
16+ - uses: actions/checkout@v4
17+
18+ - uses: actions/setup-node@v3
1819 with:
19− node-version: '17.x'
20+ node-version: 18
21+
2022 - name: Test Build
2123 working-directory: ./docs
22− env:
23− NODE_OPTIONS: --openssl-legacy-provider
2424 run: |
25− if [ -e yarn.lock ]; then
26− yarn install --frozen-lockfile
27− elif [ -e package-lock.json ]; then
2825 npm ci
29− else
30− npm i
31− fi
3226 npm run build
33− gh-release:
34− if: github.event_name != 'pull_request'
27+
28+ gh-pages-release:
29+ if: github.event_name == 'push'
3530 runs-on: ubuntu-latest
31+ permissions:
32+ contents: write
3633 steps:
37− - uses: actions/checkout@v3
38− - uses: actions/setup-node@v1
34+ - uses: actions/checkout@v4
3935 with:
40− node-version: '17.x'
41− - name: Add key to allow access to repository
42− env:
43− SSH_AUTH_SOCK: /tmp/ssh_agent.sock
44− NODE_OPTIONS: --openssl-legacy-provider
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:
45+ node-version: 18
46+
47+ - name: Build docusaurus
48+ working-directory: master/docs
49+ id: build
4550 run: |
46− mkdir -p ~/.ssh
47− ssh-keyscan github.com >> ~/.ssh/known_hosts
48− echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
49− chmod 600 ~/.ssh/id_rsa
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
56− working-directory: ./docs
51+ echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
52+ npm ci
53+ npm run build
54+
55+ - name: Release to github pages
5756 env:
58− USE_SSH: true
59− GIT_USER: git
60− NODE_OPTIONS: --openssl-legacy-provider
57+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+ working-directory: gh-pages
6159 run: |
62− git config --global user.email "actions@gihub.com"
63− git config --global user.name "gh-actions"
64− if [ -e yarn.lock ]; then
65− yarn install --frozen-lockfile
66− elif [ -e package-lock.json ]; then
67− npm ci
68− else
69− npm i
70− fi
71− npx docusaurus deploy
60+ git config --local user.name "github-actions[bot]"
61+ git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
62+
63+ # Remove all files except .git
64+ git rm -r *
65+
66+ # Copy the build files from master/docs/build to gh-pages
67+ cp -r ../master/docs/build/* .
68+
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 = {
5454 },
5555 ],
5656 ],
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+ ],
5766};
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.