diff --git a/.circleci/config.yml b/.circleci/config.yml index a020a98e8..3e02c57c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,23 +86,6 @@ jobs: steps: - checkout - run: sudo npm install -g @misk/cli && miskweb ci-build -e - docs: - machine: - image: circleci/classic:latest - parallelism: 1 - steps: - - checkout # check out source code to working directory - - run: | # mkdocs wants to be run with Python 3, force the path to prioritize pyenv 3.5.2 - pyenv global 3.5.2 - export PATH="/opt/circleci/.pyenv/versions/3.5.2/lib/:$PATH" - pip install mkdocs mkdocs-material - - run: | - ./gradlew dokka - - run: | - cat README.md | grep -v 'project website' > docs/index.md - cp CHANGELOG.md docs/changelog.md - cp RELEASING.md docs/releasing.md - - run: mkdocs build workflows: version: 2 on_commit: @@ -113,13 +96,10 @@ workflows: only: master - java - node -# Disabling this for now since it is breaking due to the python 2 -> 3 migration -# - docs nightly: jobs: - java - node - - docs triggers: - schedule: # midnight mountain time in UTC diff --git a/.github/workflows/Publish-Website.yml b/.github/workflows/Publish-Website.yml new file mode 100644 index 000000000..ce42c3179 --- /dev/null +++ b/.github/workflows/Publish-Website.yml @@ -0,0 +1,45 @@ +name: Publish the mkdocs to gh-pages + +on: + pull_request: + push: + branches: + - master + +env: + GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + +jobs: + deploy-website: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repo + uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Configure JDK + uses: actions/setup-java@v1 + with: + java-version: 14 + + - name: Prep mkdocs + run: .github/workflows/prepare_mkdocs.sh + + - name: Build mkdocs + run: | + pip3 install mkdocs-macros-plugin + mkdocs build + + - name: Deploy 🚀 + if: success() && github.ref == 'refs/heads/master' + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GH_CLIPPY_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: site # The folder the action should deploy. + SINGLE_COMMIT: true diff --git a/.github/workflows/prepare_mkdocs.sh b/.github/workflows/prepare_mkdocs.sh new file mode 100755 index 000000000..80d31dd75 --- /dev/null +++ b/.github/workflows/prepare_mkdocs.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# The website is built using MkDocs with the Material theme. +# https://squidfunk.github.io/mkdocs-material/ +# It requires Python to run. +# Install the packages with the following command: +# pip install mkdocs mkdocs-material + +set -ex + +# Generate the API docs +./gradlew dokka + +# Dokka filenames like `-http-url/index.md` don't work well with MkDocs