From 0c4686708a79da93b90a83460e100f31f319ee61 Mon Sep 17 00:00:00 2001 From: Matthew Daubney Date: Mon, 2 Nov 2026 11:43:25 +0000 Subject: [PATCH] Release workflow: build and push container image on tags (ENB-26) Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/release.yml | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..ef3df07 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,62 @@ +name: Release + +on: + push: + tags: + - "v*" + +env: + REGISTRY: git.daubney.dev + IMAGE: git.daubney.dev/${{ github.repository }} + +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 + ports: + - 8200:8200 + options: --cap-add=IPC_LOCK + env: + BAO_ADDR: http://openbao:8200 + BAO_TOKEN: root + 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 Gitea container registry + run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.repository_owner }}" --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"