name: site
on:
push:
branches: [main]
paths: ["site/**", ".github/workflows/site.yml"]
pull_request:
paths: ["site/**", ".github/workflows/site.yml"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: site-${{ github.ref }}
cancel-in-progress: true
env:
ZOLA_VERSION: "0.22.1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Zola
run: |
curl -sSL "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
| tar -xz -C /usr/local/bin zola
- name: Check links and content
working-directory: site
run: zola check
- name: Build
working-directory: site
run: zola build
- uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main'
with:
path: site/public
deploy:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@v4