Skip to content

Commit d6b03dd

Browse files
committed
ExampleSite: Configure to deploy to GH Pages
1 parent 8a9b7fb commit d6b03dd

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy Example Site (GH Pages)
2+
env:
3+
GO_VERSION: "1.23"
4+
HUGO_VERSION: "0.147.8"
5+
GH_PAGES_URL: https://nginxinc.github.io/nginx-hugo-theme
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Cancel any in-prog deployments if a newer push comes in.
19+
concurrency:
20+
group: example-site-deploy
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build-deploy:
25+
environment:
26+
name: example-site
27+
url: ${{ steps.deploy.outputs.page_url }}
28+
runs-on: ubuntu-22.04
29+
steps:
30+
- name: Setup Go
31+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 #v6.0.0
32+
with:
33+
go-version: ${{ env.GO_VERSION }}
34+
cache: false
35+
- name: Setup Hugo
36+
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f #v3.0.0
37+
with:
38+
hugo-version: ${{ env.HUGO_VERSION }}
39+
extended: true
40+
- name: Checkout repo
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
42+
with:
43+
fetch-depth: 0
44+
- name: Build exampleSite
45+
working-directory: exampleSite
46+
run: hugo --gc -e production --baseURL="$GH_PAGES_URL"
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4
49+
with:
50+
path: exampleSite/public
51+
- name: Deploy artifact to GH Pages
52+
id: deploy
53+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5
54+
55+

0 commit comments

Comments
 (0)