Skip to content
book-open

GitHub Action

Zola Deploy

0.12.2 Latest version

Zola Deploy

book-open

Zola Deploy

Deploy a Zola website to GitHub Pages

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Zola Deploy

uses: zbrox/zola-deploy-action@0.12.2

Learn more about this action in zbrox/zola-deploy-action

Choose a version

Zola Deploy Action

Build Status GitHub Release

A GitHub action to automatically build and deploy your zola site to a branch in the repository to be used for GitHub Pages.

Table of Contents

Usage

In .github/workflows you can put any .yml file and put the following contents inside.

on:
  push:
    branches:
      - master
name: Build and deploy on push
jobs:
  build:
    name: zbrox/zola-deploy-action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: zbrox/zola-deploy-action
      uses: zbrox/zola-deploy-action@master
      env:
        TOKEN: ${{ secrets.TOKEN }}

The following workflow will execute only when pushing to the master branch and will publish the zola generated pages to the gh-pages branch.

Environment Variables

  • TOKEN: Personal Access key with the scope public_repo, we need this to push the site files back to the repo.

    ( Actions already provides a GITHUB_TOKEN which is an installation token and does not trigger a GitHub Pages builds hence we need a personal access token )

  • PAGES_BRANCH: The git branch of your repo to which the built static files will be pushed. Default is gh-pages branch

Custom Domain

If you're using a custom domain for your GitHub Pages site put the CNAME in static/CNAME so that zola puts it in the root of the public folder which is where GitHub expects it to be.