name: Verify, publish, and promote on: push: branches: [master, main] paths-ignore: [deploy/values-srs.yaml] pull_request: jobs: verify: runs-on: ubuntu-22.04 services: postgres: image: postgres:17-alpine env: POSTGRES_USER: aeternalis POSTGRES_PASSWORD: ci-test-only POSTGRES_DB: aeternalis_test options: >- --health-cmd "pg_isready -U aeternalis -d aeternalis_test" --health-interval 5s --health-timeout 5s --health-retries 10 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: "24", cache: npm } - uses: actions/setup-go@v5 with: { go-version-file: server/go.mod, cache-dependency-path: server/go.sum } - run: npm ci --no-fund - run: npm run test:contracts && npm run check && npm run build - name: Go tests, race detector, and PostgreSQL integration working-directory: server env: TEST_DATABASE_URL: postgres://aeternalis:ci-test-only@postgres:5432/aeternalis_test?sslmode=disable run: go test -race -count=1 ./... - name: Go static analysis working-directory: server run: go vet ./... - run: npx playwright install --with-deps chromium - run: npm run test:e2e - uses: azure/setup-helm@v4.3.0 - run: | helm lint deploy/chart helm template aeternalis deploy/chart > /tmp/aeternalis.yaml helm lint deploy/chart -f deploy/values-srs.yaml helm template aeternalis deploy/chart -f deploy/values-srs.yaml > /tmp/aeternalis-srs.yaml publish: if: gitea.event_name == 'push' needs: verify runs-on: ubuntu-22.04 outputs: digest: ${{ steps.build.outputs.digest }} env: # gitea-runner-config sets container.options: --add-host=docker-host:host-gateway, # meant to make "docker-host" resolve inside job containers -- but that alias isn't # landing on this job's own container (DNS lookup of docker-host fails), even though # act_runner's own connection to the same daemon (proven by verify's Postgres service # working) resolves it via the pod's hostAliases to 172.17.0.1. Use that address # directly rather than depend on the container-option alias. # TODO(ops): fix container.options/--add-host so job containers get "docker-host" # for real, then this can go back to using that name instead of a hardcoded IP. DOCKER_HOST: tcp://172.17.0.1:2375 steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: registry: ${{ vars.HARBOR_HOST }} username: ${{ secrets.HARBOR_USERNAME }} password: ${{ secrets.HARBOR_PASSWORD }} - uses: docker/build-push-action@v6 id: build with: context: . push: true tags: ${{ vars.HARBOR_HOST }}/${{ vars.HARBOR_PROJECT }}/aeternalis:${{ gitea.sha }} provenance: true sbom: true promote: if: gitea.event_name == 'push' && vars.GITOPS_REPOSITORY != '' needs: publish runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: "24" } - run: npm ci --no-fund - name: Update GitOps image digest env: GITOPS_REPOSITORY: ${{ vars.GITOPS_REPOSITORY }} GITOPS_BRANCH: ${{ vars.GITOPS_BRANCH }} GITOPS_VALUES_FILE: ${{ vars.GITOPS_VALUES_FILE }} GITOPS_USERNAME: ${{ secrets.GITOPS_USERNAME }} GITOPS_TOKEN: ${{ secrets.GITOPS_TOKEN }} IMAGE_REPOSITORY: ${{ vars.HARBOR_HOST }}/${{ vars.HARBOR_PROJECT }}/aeternalis IMAGE_DIGEST: ${{ needs.publish.outputs.digest }} run: node tools/promote-gitops.mjs