Skip to content

Commit

Permalink
Merge pull request #608 from hachyderm/feat/use-tool-versions
Browse files Browse the repository at this point in the history
Feature: use .tool-versions
  • Loading branch information
ThisIsMissEm authored Jan 30, 2025
2 parents 0f404b1 + 0f3b1fe commit 0a2d397
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Deploy Hugo site to Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
Expand All @@ -12,7 +10,7 @@ permissions:
id-token: write

concurrency:
group: "pages"
group: "pages-${{ github.ref_name }}"
cancel-in-progress: true

jobs:
Expand All @@ -21,19 +19,41 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Hugo Version
id: hugo_version
run: |
HUGO_VERSION=$(cat .tool-versions | grep hugo | cut -d' ' -f2 | cut -d'_' -f2)
echo "HUGO_VERSION=$HUGO_VERSION" >> "$GITHUB_ENV"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.139.4"
hugo-version: ${{ env.HUGO_VERSION }}
extended: true

- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
# The action defaults to search for the dependency file (package-lock.json,
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
# hash as a part of the cache key.
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
cache-dependency-path: "**/package-lock.json"

- name: Build
run: make -C community.hachyderm.io hugo

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
path: community.hachyderm.io/public/

# Only run deploy on main branch, all others just run the build as a CI step.
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hugo extended_0.139.4
node 22

0 comments on commit 0a2d397

Please sign in to comment.