39 lines
943 B
YAML
39 lines
943 B
YAML
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 }}
|