-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (104 loc) · 3.49 KB
/
deploy.yaml
File metadata and controls
122 lines (104 loc) · 3.49 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Deploy site to GitHub Pages
# Adapted from https://gohugo.io/host-and-deploy/host-on-github-pages/
# Run when when a 'deploy/YYYY-MM-DD-rN' tag is pushed or when dispatched
# manually.
on:
push:
tags:
- "deploy/20[2-9][0-9]-[01][0-9]-[0-3][0-9]-r[0-9]"
workflow_dispatch:
# Grant permissions to deploy to GitHub pages.
permissions:
contents: read
pages: write
id-token: write
# Limit to one deployment at a time and always finish pending jobs.
concurrency:
group: pages
cancel-in-progress: false
# Run commands using Bash.
defaults:
run:
shell: bash
# Generate, upload, and deploy site.
jobs:
build:
runs-on: ubuntu-latest
env:
DART_SASS_VERSION: 1.96.0
GO_VERSION: 1.25.5
HUGO_VERSION: 0.152.2
NODE_VERSION: 24.12.0
TZ: Europe/London
steps:
- name: Checkout repository
uses: actions/checkout@v6
# # Uncomment if using Git submodules:
# with:
# submodules: recursive
# fetch-depth: 0
# # Uncomment if using Go scripts:
# - name: Set up Go
# uses: actions/setup-go@v6
# with:
# go-version: ${{ env.GO_VERSION }}
# cache: false
# # Uncomment if using Node.js packages:
# - name: Set up Node.js
# uses: actions/setup-node@v6
# with:
# node-version: ${{ env.NODE_VERSION }}
- name: Set up GitHub Pages
id: pages
uses: actions/configure-pages@v6
- name: Create executable directory
run: |
mkdir -p "${HOME}/.local"
# # Uncomment if using Dart Sass:
# - name: Install Dart Sass
# run: |
# curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
# tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
# rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
# echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
- name: Install Hugo
run: |
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
mkdir "${HOME}/.local/hugo"
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
# Add the following commands if applicable:
# echo "Dart Sass: $(sass --version)"
# echo "Go: $(go version)"
# echo "Node.js: $(node --version)"
- name: Verify installation
run: |
echo "Hugo: $(hugo version)"
# # Uncomment if using Node.js packages:
# - name: Install Node.js packages
# run: |
# [[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
- name: Configure Git
run: |
git config core.quotepath false
- name: Generate site with Hugo
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload generated site
uses: actions/upload-pages-artifact@v5
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy uploaded site to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5