Created
March 2, 2024 17:03
-
-
Save peterkos/df6ff77d9cce984f0137b4bf4b236f2a to your computer and use it in GitHub Desktop.
zola deploy but without docker, runs ~5sec
This file contains hidden or 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
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