From 09e881876fb078f0c6cd0637c1cc23e6fc7d4495 Mon Sep 17 00:00:00 2001 From: biersoeckli Date: Sat, 21 Dec 2024 11:52:44 +0000 Subject: [PATCH] added canary pipeline --- .github/workflows/build-release.yml | 2 +- .github/workflows/canary-release.yml | 59 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/canary-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index f5e4edc..7968fbd 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,4 +1,4 @@ -name: Build and Push Docker Image +name: Production - Build and Push Docker Image on: workflow_dispatch: diff --git a/.github/workflows/canary-release.yml b/.github/workflows/canary-release.yml new file mode 100644 index 0000000..50d5a6c --- /dev/null +++ b/.github/workflows/canary-release.yml @@ -0,0 +1,59 @@ +name: Canary - Build and Push Docker Image + +on: + push: + branches: + - canary + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies for backend + run: yarn install && yarn run prisma-generate + + - name: Run tests for backend + run: yarn test + + build-and-push: + runs-on: ubuntu-latest + needs: test + if: ${{ needs.test.result == 'success' }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + registry: docker.io + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v4 + with: + context: ./ + push: true + platforms: linux/amd64 + build-args: | + VERSION_ARG=canary + tags: | + quickstack/quickstack:canary