-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (64 loc) · 2.2 KB
/
Copy pathdeploy.yaml
File metadata and controls
70 lines (64 loc) · 2.2 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
59
60
61
62
63
64
65
66
67
68
69
70
name: Deploy
on:
push:
paths: ["archetypes/**", "assets/**", "content/**", "data/**", "demo/**", "i18n/**", "layouts/**", "static/**", "themes/**", "hugo.toml"]
branches: [main]
pull_request:
paths: ["archetypes/**", "assets/**", "content/**", "data/**", "demo/**", "i18n/**", "layouts/**", "static/**", "themes/**", "hugo.toml"]
workflow_dispatch:
env:
HUGO_VERSION: 0.165.0
# Build directory where the website will run its build. Use the dot (period) to use the current directory.
builddir: .
# Output directory where built files will deploy. This also will be used on Pagefind search generation.
outdir: HTML
# Default to bash
defaults:
run:
shell: bash
# Permissions required for deployments
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive
fetch-depth: 0
- name: Install Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Python Requirements
run: pip install pagefind[extended]
- name: Build
run: |
cd ${{ env.builddir }}
hugo
- name: Generate Pagefind Search
run: python -m pagefind --site ${{ env.outdir }}
- name: Upload Artifact
uses: actions/upload-pages-artifact@v5
with:
path: ${{ env.outdir }}
deploy:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5