publish-docs #6
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: publish-docs | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
repository: benpollarduk/ktvn | |
token: ${{ secrets.PAT }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Install pip | |
run: | | |
sudo apt update | |
sudo apt install python3-pip | |
- name: Install mkdocs | |
run: | | |
pip install mkdocs-material | |
- name: Build mkdocs documentation | |
run: | | |
cd docs/mkdocs/ | |
mkdocs build | |
- name: Copy website files, commit, then push changes to ktvn-docs | |
run: | | |
mkdir ktvn-docs | |
cd ktvn-docs | |
git init | |
git remote add origin https://${{ secrets.PAT }}@github.com/benpollarduk/ktvn-docs.git | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git fetch | |
git checkout main | |
git rm -r --ignore-unmatch . | |
cp -r ../docs/mkdocs/site/* . | |
git add . | |
git commit -m "Update documentation" | |
git push https://${{ secrets.PAT }}@github.com/benpollarduk/ktvn-docs.git HEAD:main | |