Repository navigation
58 lines (54 loc) · 1.72 KB
/
Copy pathwebsite.yaml
File metadata and controls
58 lines (54 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: 'Website'
on:
push:
branches: ['main']
workflow_dispatch:
workflow_call:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
jobs:
deploy:
runs-on: 'ubuntu-latest'
environment:
name: 'github-pages'
url: '${{ steps.deployment.outputs.page_url }}'
steps:
- uses: 'actions/checkout@v6'
- uses: 'actions/configure-pages@v5'
id: pages
- name: 'Prepare docs if missing'
shell: bash
run: |
if [ ! -d docs ]; then
mkdir -p docs/content docs/templates
printf '%s\n' 'base_url = "https://example.org"' > docs/config.toml
printf '+++\n+++\n\n' > docs/content/_index.md
cat README.md >> docs/content/_index.md
printf '%s\n' \
'<!doctype html><meta charset="utf-8">' \
'<main>{{ section.content | safe }}</main>' \
> docs/templates/index.html
fi
- name: 'Download Zola'
shell: bash
run: |
curl -fsSL \
'https://github.com/getzola/zola/releases/download/v0.23.0/zola-v0.23.0-x86_64-unknown-linux-gnu.tar.gz' \
-o "$RUNNER_TEMP/zola.tar.gz"
tar -xzf "$RUNNER_TEMP/zola.tar.gz" -C "$RUNNER_TEMP" zola
- name: 'Build site with Zola'
shell: bash
working-directory: 'docs'
env:
PAGES_BASE_URL: '${{ steps.pages.outputs.base_url }}'
run: |
"$RUNNER_TEMP/zola" build --base-url "$PAGES_BASE_URL" --output-dir public
- uses: 'actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b'
with:
path: 'docs/public'
- uses: 'actions/deploy-pages@v4'
id: deployment