-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.56 KB
/
deploy-site.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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