From 97909d82e83c0530c2c70d01364d478f7e04d387 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 30 Oct 2025 10:44:46 +1100 Subject: [PATCH] MAINT: Phase 1 - Add HTML archives to GitHub release assets Implements Phase 1 from issue #661: HTML archive backup on releases. Changes: - Add step to create compressed HTML archive after build - Generate SHA256 checksum for integrity verification - Create metadata manifest with build information - Upload archive, checksum, and manifest to GitHub releases Release assets created on each publish-* tag: - lecture-python-html-{tag}.tar.gz - Full HTML site archive - html-checksum.txt - SHA256 verification file - html-manifest.json - Build metadata (tag, commit, size, file count) This establishes backup infrastructure before gh-pages history cleanup and provides historical restore points for all future deployments. --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5bb328f5d..bffe4247e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -73,6 +73,32 @@ jobs: shell: bash -l {0} run: | jb build lectures --path-output ./ -n -W --keep-going + # Create HTML archive for release assets + - name: Create HTML archive + shell: bash -l {0} + run: | + tar -czf lecture-python-html-${{ github.ref_name }}.tar.gz -C _build/html . + sha256sum lecture-python-html-${{ github.ref_name }}.tar.gz > html-checksum.txt + + # Create metadata manifest + cat > html-manifest.json << EOF + { + "tag": "${{ github.ref_name }}", + "commit": "${{ github.sha }}", + "timestamp": "$(date -Iseconds)", + "size_mb": $(du -sm _build/html | cut -f1), + "file_count": $(find _build/html -type f | wc -l) + } + EOF + - name: Upload archives to release + uses: softprops/action-gh-release@v1 + with: + files: | + lecture-python-html-${{ github.ref_name }}.tar.gz + html-checksum.txt + html-manifest.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy website to gh-pages uses: peaceiris/actions-gh-pages@v4 with: