Skip to content

Instantly share code, notes, and snippets.

@peterkos
Created March 2, 2024 17:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterkos/df6ff77d9cce984f0137b4bf4b236f2a to your computer and use it in GitHub Desktop.
Save peterkos/df6ff77d9cce984f0137b4bf4b236f2a to your computer and use it in GitHub Desktop.
zola deploy but without docker, runs ~5sec
name: Zola
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows a manual run from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
#
# Note: this is a "composite" job (not using Docker),
# which should mean this thing is zippy!
#
# Helpful resources:
# - https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
# - https://github.com/actions/starter-workflows/blob/main/pages/static.yml
#
build:
runs-on: ubuntu-latest
steps:
- name: Install Zola
uses: taiki-e/install-action@v2
with:
tool: zola
- name: Checkout main branch
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build site
run: zola build --base-url "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload just the build results
path: './public'
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure GitHub Pages
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment