mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
ci(nsite): build a downloadable site archive on every push
Add .github/workflows/nsite-archive.yml (push to any branch + workflow_dispatch): npm ci + npm run build, then upload dist/ as an artifact (bitvid-site-<branch>-<shortsha>, 30d retention). GitHub serves it as a .zip with index.html at the root, ready for a manual nsite publish. The workflow holds no signing key and publishes nothing. Also add an `archive` npm script for the same output locally (bitvid-site.zip, now gitignored), and land docs/nsite-mirror-plan.md revised to the manual-publish + auto-archive model: sign client-side via NIP-07 or local nsyte, never an nsec/nbunksec in CI. The prior CI-signing workflow is retained as a labeled Phase-3 reference option. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwbE3uTiFaKRNjx5vP2muV
This commit is contained in:
1 parent
e81e65ff40
commit
10b93efa02
4 files changed
+389
No files matched your search
@@ -0,0 +1,49 @@
|
||||
# Build a fresh, downloadable site archive on every push (any branch), so a
|
||||
# ready-to-upload copy of the compiled app is always available for a MANUAL nsite
|
||||
# publish (NIP-5A). This does NOT publish anything or touch any signing key — it
|
||||
# just builds `dist/` and uploads it as a workflow artifact (GitHub serves
|
||||
# artifacts as a .zip on download). See docs/nsite-mirror-plan.md.
|
||||
name: Build site archive
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# One archive build in flight per branch; a newer push supersedes an older one.
|
||||
concurrency:
|
||||
group: nsite-archive-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
archive:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build static site
|
||||
run: npm run build
|
||||
|
||||
- name: Short SHA
|
||||
id: vars
|
||||
run: echo "sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# `path: dist` stores the site files at the artifact root (index.html at top),
|
||||
# so the downloaded .zip extracts straight to the nsite site directory.
|
||||
- name: Upload site archive
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bitvid-site-${{ github.ref_name }}-${{ steps.vars.outputs.sha }}
|
||||
path: dist
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
Reference in new issue
Block a user