[pre-commit.ci] pre-commit autoupdate #75
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: | |
pull_request: | |
workflow_call: | |
inputs: | |
artifact-name: | |
description: Name of the artifact where the built website should be uploaded | |
required: false | |
type: string | |
default: '' | |
outputs: | |
artifact-name: | |
description: Name of the artifact where the built website is uploaded | |
value: ${{ inputs.artifact-name }} | |
commit: | |
description: Short SHA of the commit of the sources | |
value: ${{ jobs.build.outputs.commit }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
commit: ${{ steps.commit.outputs.short_sha }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.125.4' | |
- name: Build | |
run: hugo | |
- name: Output commit info | |
id: commit | |
run: | | |
echo "short_sha=$(git rev-list --max-count=1 --oneline HEAD)" >> "$GITHUB_OUTPUT" | |
- name: Upload artifact | |
if: inputs.artifact-name != '' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ inputs.artifact-name }} | |
path: docs | |
retention-days: 1 |