Skip to content

Commit 1293ad9

Browse files
author
Anne-Julia Seitz
committed
Add GitHub Actions workflow for Zola deployment
- Automated deployment to GitHub Pages on main branch pushes - Build validation on pull requests - Uses Zola 0.19.1 for consistent builds - Includes link checking and proper Pages deployment
1 parent d0c37c6 commit 1293ad9

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Zola site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
if: github.ref != 'refs/heads/main'
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Zola
18+
uses: taiki-e/install-action@v2
19+
with:
20+
21+
22+
- name: Build site
23+
run: zola build
24+
25+
- name: Check internal links
26+
run: zola check
27+
28+
deploy:
29+
runs-on: ubuntu-latest
30+
if: github.ref == 'refs/heads/main'
31+
permissions:
32+
contents: read
33+
pages: write
34+
id-token: write
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Zola
43+
uses: taiki-e/install-action@v2
44+
with:
45+
46+
47+
- name: Build site
48+
run: zola build
49+
50+
- name: Setup Pages
51+
uses: actions/configure-pages@v4
52+
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: ./public
57+
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)