darts documentation build and release workflow #1
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: darts documentation build and release workflow | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "1. Clone repository" | |
uses: actions/checkout@v2 | |
- name: "2. Set up Python 3.9" | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.9' | |
- name: "3. Install pandoc" | |
run: | | |
sudo apt-get install -y pandoc | |
# downloading gradle multiple times in parallel can yield to connection errors | |
- name: "4. Cache gradle distribution" | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/wrapper/dists | |
key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: "4.1 Cache gradle packages" | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }} | |
- name: "5. Setup pip" | |
run: | | |
./gradlew setupPip | |
- name: "6. Attach cache for pip" | |
uses: actions/cache@v1 | |
id: cache | |
with: | |
path: ~/.cache/pip | |
key: release-${{ runner.os }}-pip-${{ hashFiles('requirements/core.txt', 'requirements/release.txt') }} | |
restore-keys: | | |
release-${{ runner.os }}-pip- | |
- name: "7. Build docs" | |
run: | | |
./gradlew buildDocs | |
- name: "8. Publish documentation to gh-pages" | |
uses: s0/git-publish-subdir-action@v2.2.0 | |
env: | |
REPO: self | |
BRANCH: gh-pages | |
FOLDER: docs/build/html | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |