Skip to content

Commit

Permalink
Add GitHub Actions CI to install hugo and build site
Browse files Browse the repository at this point in the history
  • Loading branch information
alecbcs committed Nov 13, 2024
1 parent f67e031 commit 204264c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci
on:
push:
branches:
- main
- hugo-rewrite
pull_request:
branches:
- main

concurrency:
group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
publish: ${{ steps.filter.outputs.publish }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # @v2
if: ${{ github.event_name == 'push' }}
with:
fetch-depth: 0

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
publish:
- '**'
publish:
if: ${{ needs.changes.outputs.publish == 'true' }}
needs: changes
uses: ./.github/workflows/publish.yml
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Site Build & Publish
on:
workflow_call:

jobs:
build-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: spack/setup-spack@5ab3c91bdefffffad9a7e45d1d156146afebb3a7
- run: |
spack mirror add develop https://binaries.spack.io/develop
spack buildcache keys --install --trust
spack -e . install
echo "$(pwd)/.spack-env/view/bin" >> $GITHUB_PATH
- run: hugo

0 comments on commit 204264c

Please sign in to comment.