build: Improve deploy wiki workflow #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy wiki | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
jobs: | |
deploy-web-app: | |
name: Deploy wiki | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Build wiki | |
run: | | |
pip3 install --upgrade pip && pip3 install mkdocs-material mkdocs-material-extensions mkdocs-minify-plugin mkdocs-static-i18n | |
./build_docs.sh | |
- name: Check out the gh-pages branch | |
run: | | |
git fetch origin gh-pages:gh-pages | |
git checkout gh-pages | |
- name: Remove old app directory | |
run: | | |
rm -rf wiki/* | |
- name: Create app directory | |
run: mkdir -p wiki | |
- name: Move build artifacts to wiki directory | |
run: | | |
mv site/* wiki/ | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
commit_message: "Update wiki" | |
branch: gh-pages | |
file_pattern: wiki/* |