infra: Basic-auth file leaves the repository (spec-v6 D16) — deploy/htpasswd gitignored, written on the VPS from the HTPASSWD_CONTENT secret; Gitea mirrors brought to full parity (permissions, STACK_DIR/CONTAINER_NAME guards)

This commit is contained in:
dong.nguyen committed 2026-10-28 11:57:23 +07:00
1 parent c535e7a295
commit a5ff55bacf
11 files changed
+199 -63

No files matched your search

+33 -3
View File
@@ -12,9 +12,12 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
# Site identity (spec-v4-deploy-infra D10/D12): the build and the resume
permissions:
contents: read
# Site identity (spec-v4-deploy-infra D10/D12, spec-v6 D3): the build and the resume
# generator derive every published URL and the page title from these two
# values; the build fails loudly when either is missing.
# values; the build fails loudly when either is missing. They are repository
# variables — public values, not secrets.
env:
SITE_URL: ${{ vars.SITE_URL }}
SITE_NAME: ${{ vars.SITE_NAME }}
@@ -36,6 +39,8 @@ jobs:
generate-resume:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
env:
SITE_URL: ${{ vars.SITE_URL }}
SITE_NAME: ${{ vars.SITE_NAME }}
@@ -82,7 +87,32 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: [build, generate-resume]
permissions:
contents: read
steps:
# The stack directory is the server's deployment layout, not repository
# content: it comes from the STACK_DIR repository variable (spec-v6 D15). An
# empty or malformed value would aim rsync at /dist/ on the remote host, so the
# job refuses it here — before any artifact download, before anything reaches the
# server — exactly like the site-identity check refuses a missing SITE_URL.
- name: Check stack directory
env:
STACK_DIR: ${{ vars.STACK_DIR }}
run: |
case "$STACK_DIR" in
/*) ;;
*)
echo "::error::STACK_DIR is not an absolute path — add it as a repository variable (Settings → Actions → Secrets and Variables → Variables), value: the Dockge stack directory, e.g. /opt/stacks/dong-site"
exit 1
;;
esac
case "$STACK_DIR" in
*/)
echo "::error::STACK_DIR must not end with / — this job appends /dist/ itself"
exit 1
;;
esac
echo "Deploy target: $STACK_DIR/dist/"
- uses: actions/download-artifact@v8
with:
name: static-site
@@ -104,7 +134,7 @@ jobs:
debug: true
switches: -avzr --delete
path: dist/
remote_path: /opt/stacks/dong-site/dist/
remote_path: ${{ vars.STACK_DIR }}/dist/
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_SSH_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}