From fb3c175e348bc121dad3db814f3de17ed4c75a75 Mon Sep 17 00:00:00 2001 From: Xavier Moffett Date: Mon, 23 Dec 2024 00:53:09 -0500 Subject: [PATCH] Designate scheduled action to execute once per year - Schedule action runner to run once per year at midnight on the first day of January - Use `sha256sum` instead of `git` commit hashes for revision hash - Set modification time of `website.tar.zst` to UNIX epoch - Use GNU tar instead of busybox tar --- .forgejo/workflows/generate.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/generate.yml b/.forgejo/workflows/generate.yml index e194893..c2cdca8 100644 --- a/.forgejo/workflows/generate.yml +++ b/.forgejo/workflows/generate.yml @@ -2,6 +2,8 @@ name: Generate Website on: workflow_dispatch: + schedule: + - cron: '0 0 1 1 *' push: branches: - master @@ -11,18 +13,14 @@ env: USER_NAME: ${{ vars.USER }} jobs: - build: + generate: name: Generate Website runs-on: docker container: image: alpine - strategy: - matrix: - toolchain: - - stable steps: - name: Install packages - run: apk add --no-cache nodejs git git-lfs bash curl zstd + run: apk add --no-cache nodejs git git-lfs bash curl tar zstd - name: Checkout repository uses: actions/checkout@v4 with: @@ -67,8 +65,8 @@ jobs: run: | echo "::group:: Packaging website" cd output - tar acvf website.tar.zst * - echo "$(git rev-parse --short HEAD)$(git -C ../suo rev-parse --short HEAD)" > website.ver + tar --mtime=1970-01-01 -acvf website.tar.zst * + SUM=$(sha256sum website.tar.zst); echo "${SUM% *}" > website.ver echo "::endgroup::" - name: Upload package shell: bash