Add CI/CD: Gitea Actions workflows + Act Runner
- .gitea/workflows/test.yml: unit tests + build on every push
- .gitea/workflows/deploy.yml: auto deploy to production on push to main
- .gitea/workflows/preview.yml: PR preview environments at pr-{id}.oil.oci.euphon.net
- Bakes production DB copy into preview image (no PVC needed)
- Auto-creates namespace + deployment + ingress with TLS
- Comments PR with preview URL
- Tears down on PR close
- scripts/setup-runner.sh: act_runner installation script
Runner: hera-runner (host mode, ubuntu-latest label)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
.gitea/workflows/deploy.yml
Normal file
23
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Deploy Production
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Unit tests
|
||||
run: cd frontend && npm ci && npm run test:unit
|
||||
|
||||
- name: Build & Deploy
|
||||
run: |
|
||||
rsync -az --exclude node_modules --exclude .git --exclude .venv . oci:~/oil-calculator/
|
||||
ssh oci "
|
||||
cd ~/oil-calculator &&
|
||||
docker build -t registry.oci.euphon.net/oil-calculator:latest . &&
|
||||
docker push registry.oci.euphon.net/oil-calculator:latest &&
|
||||
sudo k3s kubectl rollout restart deploy/oil-calculator -n oil-calculator
|
||||
"
|
||||
Reference in New Issue
Block a user