Build Hugo site from push #5
This file contains hidden or 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 Hugo site from push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # SCHEDULE AND WORKFLOW DISPATCH ARE FOR TESTING | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| env: | |
| HUGO_SOURCE_DIR: "." | |
| HUGO_BASE_URL: "" | |
| HUGO_OUTPUT_DIR: "public" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Build site | |
| uses: omsf/static-site-tools/build/hugo@main | |
| with: | |
| base-url: ${{ env.HUGO_BASE_URL }} | |
| source-directory: ${{ env.HUGO_SOURCE_DIR }} | |
| output-directory: ${{ env.HUGO_OUTPUT_DIR }} | |
| - name: Make artifact | |
| shell: bash | |
| run: tar czf site.tar.gz -C ${{ env.HUGO_SOURCE_DIR }} ${{ env.HUGO_OUTPUT_DIR }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: site-build | |
| path: site.tar.gz | |
| if-no-files-found: error | |
| retention-days: 1 |