Skip to content

Commit 851f513

Browse files
author
David Baker Effendi
authored
GitHub Pages Deployment (#1)
Following the latest Hugo docs, created a suitable deployment.
1 parent d2d45bb commit 851f513

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
env:
17+
HUGO_VERSION: 0.135.0
18+
steps:
19+
- name: Install Hugo CLI
20+
run: |
21+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
22+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
23+
- name: Install Dart Sass
24+
run: sudo snap install dart-sass
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: recursive
29+
fetch-depth: 0
30+
- name: Setup Pages
31+
id: pages
32+
uses: actions/configure-pages@v5
33+
- name: Install Node.js dependencies
34+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
35+
- name: Build with Hugo
36+
env:
37+
# For maximum backward compatibility with Hugo modules
38+
HUGO_ENVIRONMENT: production
39+
HUGO_ENV: production
40+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
41+
run: |
42+
hugo \
43+
--gc \
44+
--minify \
45+
--baseURL "https://flatgraph.joern.io/"
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: ./public
50+
51+
# Deployment job
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
59+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
60+
permissions:
61+
pages: write # to deploy to Pages
62+
id-token: write # to verify the deployment originates from an appropriate source
63+
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)