From 9dba33aa9f4e2846b7292725e7a6a9fd98faf207 Mon Sep 17 00:00:00 2001 From: Tomas Kracmar Date: Thu, 16 Apr 2026 11:40:28 +0200 Subject: [PATCH] chore(release): add v1.0.0 versioning, release workflow, and versioned docker image - Add VERSION file (1.0.0) - Add GitHub Actions release workflow to build and push Docker images to ghcr.io - Update docker-compose.yml to pull ghcr.io/cqrenet/aoc-backend:v1.0.0 by default --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ VERSION | 1 + docker-compose.yml | 3 +- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 VERSION diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a653af7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Release + +on: + push: + tags: + - "v*" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}-backend + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: ./backend + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0 diff --git a/docker-compose.yml b/docker-compose.yml index d4069ae..6978ecf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,8 @@ services: - mongo_data:/data/db backend: - build: ./backend + # For local development you can switch back to: build: ./backend + image: ghcr.io/cqrenet/aoc-backend:v1.0.0 container_name: aoc-backend restart: always env_file: