36 lines
1.0 KiB
YAML
36 lines
1.0 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@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
- name: Validate release tag
|
|
run: npm run verify:release
|
|
- run: npm ci
|
|
- 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@v2
|
|
with:
|
|
files: ${{ env.ARCHIVE_NAME }}
|