diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..51a89d62 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..ca76c870 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +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 + hugo