remove empty block (#57) #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: ["main"] | |
workflow_call: | |
inputs: | |
production: | |
type: boolean | |
default: true | |
jobs: | |
build: | |
name: Build Site | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: "0.139.4" | |
extended: true | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
cache: "pnpm" | |
- name: Install dependencies | |
run: "pnpm i -P" | |
- name: Build with Hugo | |
env: | |
HUGO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache | |
HUGO_ENVIRONMENT: ${{ inputs.production && 'production' || 'development' }} | |
ACTOR: ${{ github.event.pull_request.user.login }} | |
REF: ${{ github.event.pull_request.head.ref }} | |
run: | | |
if [ "$HUGO_ENVIRONMENT" = "production" ]; then | |
export HUGO_PAGE_URL="https://v2.galaxypedia.org" | |
else | |
export HUGO_PAGE_URL="https://${ACTOR}-${REF}.galaxypedia.pages.dev" | |
fi | |
echo $HUGO_PAGE_URL | |
hugo --minify --baseURL "$HUGO_PAGE_URL" | |
- name: Build Pagefind index | |
run: pnpm pagefind | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pages-build | |
path: ./public |