Skip to content

Correct asset redirect generation shell script #61

Correct asset redirect generation shell script

Correct asset redirect generation shell script #61

Workflow file for this run

name: Pages
on:
push:
branches:
- main
pull_request: {}
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.118.2"
extended: true
- name: Setup swap space
# The Hugo build can require a significant amount of memory
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
with:
swap-size-gb: 10
- name: Get the list of tagged revisions (for cache)
id: get-revisions
run: |
echo revisions_hash=$(cd support/OSCAL; git tag | grep -E '^v\d+\.\d+\.\d+$' | sha256sum) >> $GITHUB_OUTPUT
shell: bash
- name: Cache generated content for existing tags
uses: actions/cache@v3
with:
# explicitly do not cache develop as they are likely to change
path: |
site/content/models/v*/
site/data/models/v*/
key: ${{ hashFiles('site/archetypes/**') }}-${{ hashFiles('support/*.sh') }}-${{ steps.get-revisions.outputs.revisions_hash }}
# A new tagged revision will invalidate the primary cache key
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
restore-keys: |
${{ hashFiles('site/archetypes/**') }}-${{ hashFiles('support/*.sh') }}
- name: Build
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# GHA runners have 2 CPUs
run: make site -j2
- name: Deploy
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# personal_token: ${{ secrets.COMMIT_TOKEN }}
enable_jekyll: false
publish_dir: ./site/public
publish_branch: nist-pages
user_name: OSCAL GitHub Actions Bot
user_email: [email protected]
commit_message: Deploying website [ci deploy]