Skip to content

Commit

Permalink
Update publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchenli-sony authored Mar 8, 2025
1 parent 7417a5c commit b2b9f9a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ env:

on:
push:
branches:
- main
branches: ["main"]
workflow_dispatch:

permissions:
Expand All @@ -20,47 +19,48 @@ concurrency:

jobs:
build:
if: github.repository_owner != 'HugoBlox'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v4
uses: peaceiris/actions-hugo@v2.6.0
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true

- name: Cache Hugo Modules
- name: Cache Hugo modules
uses: actions/cache@v4
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Build site
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
hugo --minify --baseURL "${{ github.pages_url }}/"
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Generate Pagefind search index
run: npx pagefind --site "public"

- name: Upload artifact
uses: actions/upload-pages-artifact@v4
uses: actions/upload-pages-artifact@v3
with:
path: public
path: ./public

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

0 comments on commit b2b9f9a

Please sign in to comment.