bhodrolok's building & deploying the zola site to GitHub Pages! #56
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
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables | |
# https://www.getzola.org/documentation/deployment/github-pages/ | |
name: Deploy Zola Site to GitHub Pages | |
run-name: ${{ github.actor }}'s building & deploying the zola site to GitHub Pages! | |
on: | |
push: | |
branches: | |
- main | |
#pull_request: | |
# Allows workflow to be manually run from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# Build, not deploy, iff PR | |
if: github.ref != 'refs/heads/main' | |
steps: | |
- name: Checkout main code so workflow can be accessed | |
uses: actions/checkout@v3.0.0 | |
- name: build and deploy zola site to the main branch as GitHub Pages | |
uses: shalzz/zola-deploy-action@master | |
env: | |
# https://github.com/shalzz/zola-deploy-action#environment-variables | |
BUILD_DIR: public | |
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/main' | |
name: Build zola site + Deploy to GitHub Pages | |
steps: | |
- name: Checkout main code so workflow can be accessed | |
uses: actions/checkout@v3.0.0 | |
- name: build and deploy zola site to the main branch as GitHub Pages | |
uses: shalzz/zola-deploy-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAGES_ZOLA_TOKEN }} | |
OUT_DIR: public | |
PAGES_BRANCH: gh-pages |