feat(deploy): add full CD pipeline infrastructure for DeepDrftHome
Four Gitea workflows (deploy-public, deploy-manager, deploy-api, package-install) and a complete deploy/ folder: bootstrap, install, ssh-wrapper, three deploy scripts, setup-step10-creds, three systemd user units, two nginx vhost templates. Models Skipper's deploy infrastructure with key deviations: flat csproj paths, dual PostgreSQL databases, FileDatabase vault directory (never touched on deploy), EF bundle covers DeepDrftContext only (AuthBlocks self-migrates at boot), deploy-api reads DB connection from host credentials not CI args.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
name: Package install tarball
|
||||
|
||||
# Authentication: uses the built-in gitea.token (auto-injected per run).
|
||||
# No manual secret required.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, dev]
|
||||
paths:
|
||||
- 'deploy/**'
|
||||
|
||||
jobs:
|
||||
package:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build install tarball
|
||||
run: |
|
||||
tar -czf deepdrft-install.tar.gz \
|
||||
--exclude=deploy/bootstrap.sh \
|
||||
--transform 's|^deploy/||' \
|
||||
deploy/
|
||||
|
||||
- name: Create Gitea release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||
GITEA_REPO: ${{ gitea.repository }}
|
||||
run: |
|
||||
SHORT_SHA="${GITHUB_SHA::7}"
|
||||
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
|
||||
TAG="install-$(date +%Y%m%d)-${SHORT_SHA}"
|
||||
PRERELEASE="false"
|
||||
else
|
||||
TAG="beta-$(date +%Y%m%d)-${SHORT_SHA}"
|
||||
PRERELEASE="true"
|
||||
fi
|
||||
|
||||
# Create the release via Gitea API
|
||||
RELEASE_URL=$(curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPO}/releases" \
|
||||
-d "{
|
||||
\"tag_name\": \"${TAG}\",
|
||||
\"name\": \"Install package ${TAG}\",
|
||||
\"body\": \"Self-contained install tarball. Commit: ${GITHUB_SHA}\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": ${PRERELEASE}
|
||||
}" | jq -r '.upload_url')
|
||||
|
||||
# upload_url from Gitea includes {?name,label} template — strip it
|
||||
UPLOAD_BASE="${RELEASE_URL%\{*\}}"
|
||||
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
"${UPLOAD_BASE}?name=deepdrft-install.tar.gz" \
|
||||
--data-binary @deepdrft-install.tar.gz
|
||||
|
||||
echo "Released as tag: ${TAG}"
|
||||
echo "Asset URL: ${GITEA_SERVER_URL}/${GITEA_REPO}/releases/download/${TAG}/deepdrft-install.tar.gz"
|
||||
Reference in New Issue
Block a user