diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml new file mode 100644 index 0000000..d199cd8 --- /dev/null +++ b/.github/workflows/docs-publish.yml @@ -0,0 +1,38 @@ +name: Zola on GitHub Pages + +on: + push: + branches: + - master + paths: + - docs/** + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/master' + steps: + - name: Checkout main + uses: actions/checkout@v4 + - name: Build only + uses: shalzz/zola-deploy-action@v0.18.0 + env: + BUILD_DIR: docs + BUILD_ONLY: true + BUILD_FLAGS: --drafts + # A GitHub token is not necessary when BUILD_ONLY is true + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build_and_deploy: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + steps: + - name: Checkout main + uses: actions/checkout@v4 + - name: Build and deploy + uses: shalzz/zola-deploy-action@v0.18.0 + env: + BUILD_DIR: docs + PAGES_BRANCH: gh-pages + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}