Compare commits
11 Commits
0d743402ac
...
ca2a725953
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca2a725953 | ||
|
|
fdb0411c35 | ||
|
|
461b5e0cd6 | ||
|
|
28fcaf16c5 | ||
|
|
cb21be71f0 | ||
|
|
60813e44d9 | ||
|
|
c438d67469 | ||
| bb6b8e63d7 | |||
| 259871d34a | |||
| ba6069f14e | |||
| 65667d9b50 |
@@ -1,10 +1,14 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# cameleer-website — Deploy to Hetzner Webhosting L
|
# cameleer-website — Deploy to Hetzner Webhosting L
|
||||||
#
|
#
|
||||||
# Runs ONLY on pushes to `main` and on manual dispatch from the Gitea UI.
|
# MANUAL TRIGGER ONLY. Runs exclusively on workflow_dispatch from the Gitea UI
|
||||||
# Does NOT run Lighthouse CI (that's in ci.yml — assume any commit that reached
|
# (Actions → deploy → Run workflow). Does NOT auto-deploy on push to main —
|
||||||
# main already passed the full gate). Rebuilds fresh, runs the TBD guard, and
|
# merges to main must be explicitly promoted to production.
|
||||||
# rsyncs `dist/` to the origin over SSH with host-key pinning.
|
#
|
||||||
|
# Build and deploy run in a single job so the built dist/ (including
|
||||||
|
# dotfiles like .htaccess) flows directly into rsync. An earlier split-job
|
||||||
|
# design was abandoned because actions/upload-artifact@v3 excludes dotfiles
|
||||||
|
# by default and the v4 client does not work on Gitea Actions / GHES.
|
||||||
#
|
#
|
||||||
# Runner: self-hosted arm64 Gitea runner. Adjust `runs-on` if your runner's
|
# Runner: self-hosted arm64 Gitea runner. Adjust `runs-on` if your runner's
|
||||||
# labels differ. Deploy target is Hetzner amd64 — arch mismatch is a non-issue
|
# labels differ. Deploy target is Hetzner amd64 — arch mismatch is a non-issue
|
||||||
@@ -12,15 +16,12 @@
|
|||||||
#
|
#
|
||||||
# Required secrets (repo settings → Actions → Secrets):
|
# Required secrets (repo settings → Actions → Secrets):
|
||||||
# SFTP_HOST, SFTP_USER, SFTP_PATH, SFTP_KEY, SFTP_KNOWN_HOSTS
|
# SFTP_HOST, SFTP_USER, SFTP_PATH, SFTP_KEY, SFTP_KNOWN_HOSTS
|
||||||
# Required variables (repo settings → Actions → Variables):
|
|
||||||
# PUBLIC_AUTH_SIGNIN_URL, PUBLIC_AUTH_SIGNUP_URL, PUBLIC_SALES_EMAIL
|
# PUBLIC_AUTH_SIGNIN_URL, PUBLIC_AUTH_SIGNUP_URL, PUBLIC_SALES_EMAIL
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
name: deploy
|
name: deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -28,9 +29,9 @@ concurrency:
|
|||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 25
|
||||||
env:
|
env:
|
||||||
PUBLIC_AUTH_SIGNIN_URL: ${{ secrets.PUBLIC_AUTH_SIGNIN_URL }}
|
PUBLIC_AUTH_SIGNIN_URL: ${{ secrets.PUBLIC_AUTH_SIGNIN_URL }}
|
||||||
PUBLIC_AUTH_SIGNUP_URL: ${{ secrets.PUBLIC_AUTH_SIGNUP_URL }}
|
PUBLIC_AUTH_SIGNUP_URL: ${{ secrets.PUBLIC_AUTH_SIGNUP_URL }}
|
||||||
@@ -62,36 +63,14 @@ jobs:
|
|||||||
test -f public/.htaccess
|
test -f public/.htaccess
|
||||||
cp public/.htaccess dist/.htaccess
|
cp public/.htaccess dist/.htaccess
|
||||||
|
|
||||||
- name: Guard — no TODO markers may ship in built HTML
|
- name: Guard — no TBD markers may ship in built HTML
|
||||||
run: |
|
run: |
|
||||||
if grep -rlE '(TODO|TBD):' dist 2>/dev/null | grep -E '\.(html|svg)$'; then
|
if grep -rlE '(TBD):' dist 2>/dev/null | grep -E '\.(html|svg)$'; then
|
||||||
echo "Built output contains unfilled <TODO:...> (or legacy <TBD:...>) markers."
|
echo "Built output contains unfilled <TBD:...>) markers."
|
||||||
echo "Fill in imprint.astro and privacy.astro operator fields before merging to main."
|
echo "Fill in imprint.astro and privacy.astro operator fields before merging to main."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Pin to v3 — Gitea Actions implements the v3 artifact protocol.
|
|
||||||
# upload/download-artifact@v4 talk to a github.com-only backend and
|
|
||||||
# fail with GHESNotSupportedError on Gitea / Forgejo / GHES.
|
|
||||||
- name: Upload dist artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: dist
|
|
||||||
path: dist/
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download dist artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: dist
|
|
||||||
path: dist/
|
|
||||||
|
|
||||||
- name: Configure SSH
|
- name: Configure SSH
|
||||||
env:
|
env:
|
||||||
SFTP_KEY: ${{ secrets.SFTP_KEY }}
|
SFTP_KEY: ${{ secrets.SFTP_KEY }}
|
||||||
|
|||||||
Reference in New Issue
Block a user