Files
envbao-admin/.gitea/workflows/release.yml
T
mattandClaude Sonnet 5.5 11c9483a88 Demo and CI: Postgres and SSH server for the dynamic engines
docker compose now runs a Postgres with sample tables and an SSH server
that trusts the CA in OpenBao's ssh/ engine. seed.sh configures the
database engine (dynamic and static roles), the ssh CA and a role, a few
live leases, and grants for alice and the platform group. CI gains a
Postgres service so the database engine and its admin-policy rules are
tested against a real database (skipped when BAO_PG_URL is unset).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 13:58:59 +00:00

87 lines
2.5 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
env:
REGISTRY: pkgs.daubney.dev
IMAGE: pkgs.daubney.dev/envbao/envbao-admin
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
- run: npm audit --audit-level=high
- run: npm test
- run: npm run build
integration:
runs-on: ubuntu-latest
services:
openbao:
image: openbao/openbao:latest
env:
BAO_DEV_ROOT_TOKEN_ID: root
BAO_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
options: --cap-add=IPC_LOCK
# For the database secrets engine tests. Reached by service name from OpenBao, so no host port.
postgres:
image: postgres:17-alpine
env:
POSTGRES_DB: app
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd "pg_isready -U postgres -d app"
--health-interval 2s
--health-retries 15
env:
BAO_ADDR: http://openbao:8200
BAO_TOKEN: root
BAO_PG_URL: postgresql://postgres:postgres@postgres:5432/app?sslmode=disable
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run test:integration
image:
needs: [check, integration]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the container registry
run: echo "${{ secrets.PKGS_PASSWORD }}" | docker login "$REGISTRY" -u "${{ secrets.PKGS_USER }}" --password-stdin
- name: Build and push
run: |
VERSION="${GITHUB_REF_NAME#v}"
docker build -t "$IMAGE:$VERSION" -t "$IMAGE:latest" .
docker push "$IMAGE:$VERSION"
docker push "$IMAGE:latest"
# Gitea cannot trigger another repo's workflow from a tag, so dispatch the deploy via the API.
trigger-deploy:
needs: [image]
if: ${{ !contains(github.ref_name, '-') }}
runs-on: ubuntu-latest
steps:
- name: Dispatch the deploy
env:
TAG: ${{ github.ref_name }}
TOKEN: ${{ secrets.DEPLOY_DISPATCH_TOKEN }}
run: |
curl -fsS -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
-d "{\"ref\":\"main\",\"inputs\":{\"tag\":\"$TAG\"}}" \
"${{ gitea.server_url }}/api/v1/repos/matt/EnvBaoAdminDeploy/actions/workflows/deploy.yml/dispatches"