- .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>
24 lines
675 B
YAML
24 lines
675 B
YAML
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
|
|
"
|