Files
website/.github/workflows/release.yml
chrnx 8db3408ea2
CI / build (pull_request) Successful in 28s
ci: install the latest Node 22 instead of the runner's cached one
Astro 7.4.12 requires Node >=22.23.4; the Gitea runner's tool cache had 22.23.1, so astro build refused to start.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-11-17 17:11:51 -06:00

47 lines
1.9 KiB
YAML

name: Release → dist.tar.gz
# Production artifact. Runs on GITHUB ONLY, on a version tag. Builds the static site
# and packages dist/ as a .tar.gz attached to the GitHub release — the cPanel deploy
# pulls that artifact.
on:
push:
tags: ['v*']
jobs:
package:
if: ${{ github.server_url == 'https://github.com' }}
permissions:
contents: write
runs-on: ubuntu-latest
env:
ARCHIVE_NAME: green-tea-site-${{ github.ref_name }}.tar.gz
RELEASE_TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22'
check-latest: true # the runner's cached 22 can lag behind Astro's minimum
- name: Validate release tag
run: npm run verify:release
- run: npm ci
# Deliberately `critical`, not `moderate`. npm audit reads a live advisory feed,
# so a release gated on it fails by calendar date rather than by anything the
# release changed — and it fails at the exact moment there is least time to judge
# whether a fix is safe. What ships here is built HTML, CSS and JS: Astro, js-yaml
# and friends are build-time tools that never reach a visitor. `critical` keeps a
# tripwire for the catastrophic case without breaking releases on routine noise.
# ci.yml gates every PR the same way, and audit.yml files an issue for moderate and up on a
# schedule, so advisories still surface — just not as a broken release.
- run: npm audit --audit-level=critical
- run: npm run check
- name: Package dist/
run: tar -czf "$ARCHIVE_NAME" -C dist .
- name: Verify .htaccess in archive
run: tar -tzf "$ARCHIVE_NAME" | grep -Fx './.htaccess'
- name: Attach to GitHub release
uses: softprops/action-gh-release@v3
with:
prerelease: true
files: ${{ env.ARCHIVE_NAME }}