Skip to content

Commit

Permalink
Fix GitHub workflow to build the Hugo site
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinbalani committed Apr 21, 2024
1 parent 07c93b7 commit 15aacc5
Show file tree
Hide file tree
Showing 5 changed files with 2,471 additions and 17 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/live-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,39 @@ defaults:
jobs:
build:
runs-on: ubuntu-latest
env:
# DO NOT bump to 0.123+, due to https://github.com/google/docsy/issues/1874
HUGO_VERSION: 0.122.0
steps:
- name: Install Hugo CLI
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 Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Build with Hugo

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Install Hugo and other dependencies
run: npm ci

- name: Build the site
run: |
npm run build
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact

- name: Bundle up built site as an artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/

# Hugo-generated files
/public/
/resources/_gen/
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/emfcamp/developer.emfcamp.org

go 1.12
go 1.14

require github.com/google/docsy v0.9.1 // indirect
Loading

0 comments on commit 15aacc5

Please sign in to comment.