Merge pull request #203 from IMDA-BTG/docs-api-connector #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: Deploy MkDocs | |
on: | |
push: | |
branches: | |
- docs | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout docs branch | |
uses: actions/checkout@v2 | |
with: | |
ref: docs | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build the site | |
run: mkdocs build | |
- name: Move site content to a temporary directory | |
run: | | |
mkdir ../temp | |
mv site/* ../temp | |
- name: Checkout gh-pages branch | |
run: git checkout gh-pages | |
- name: Move site content back from the temporary directory | |
run: | | |
rm -rf * # This will delete the current contents of gh-pages | |
mv ../temp/* . | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.AIV_TOKEN }} | |
commit-message: "Update documentation" | |
title: "Update documentation" | |
body: "Update documentation" | |
branch: "update-documentation" | |
labels: | | |
automerge, | |
documentation |