From 5d5bb012afec762fafc487b8fb4d8b087ace1489 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 4 Jan 2025 11:35:37 +0100 Subject: [PATCH 1/2] Fix Github Actions for Version Tag --- .../workflows/docker-image-version-tag.yml | 58 ++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image-version-tag.yml b/.github/workflows/docker-image-version-tag.yml index b69b700..49be997 100644 --- a/.github/workflows/docker-image-version-tag.yml +++ b/.github/workflows/docker-image-version-tag.yml @@ -12,6 +12,23 @@ jobs: test: runs-on: ubuntu-latest name: Run Test Cases + + services: + mariadb: + image: mariadb:latest + ports: + - 3306:3306 + env: + MARIADB_DATABASE: openbudgeteer + MARIADB_USER: openbudgeteer + MARIADB_PASSWORD: openbudgeteer + MARIADB_ROOT_PASSWORD: openbudgeteer + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + steps: - name: Check out repo uses: actions/checkout@v3 @@ -28,10 +45,47 @@ jobs: run: dotnet build OpenBudgeteer.Blazor --configuration Release --no-restore - name: Run Core Test Cases + env: + CONNECTION_PROVIDER: mariadb + CONNECTION_SERVER: localhost + CONNECTION_PORT: 3306 + CONNECTION_USER: openbudgeteer + CONNECTION_PASSWORD: openbudgeteer + CONNECTION_DATABASE: openbudgeteer run: dotnet test OpenBudgeteer.Core.Test - deploy-docker: + + deploy-docker-app: runs-on: ubuntu-latest - name: Build and Push Docker Image + name: Build and Push Docker Image (App) + needs: test + if: success() + steps: + - name: Check out repo + uses: actions/checkout@v3 + + - name: Docker Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: axelander/openbudgeteer:pre-release + platforms: linux/arm64,linux/amd64 + + deploy-docker-api: + runs-on: ubuntu-latest + name: Build and Push Docker Image (API) needs: test if: success() steps: From ee83f9849f6983e1d82a942759968e6fdb841243 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 4 Jan 2025 11:39:52 +0100 Subject: [PATCH 2/2] Remove API Container creation in Github Actions for Version Tag --- .../workflows/docker-image-version-tag.yml | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/.github/workflows/docker-image-version-tag.yml b/.github/workflows/docker-image-version-tag.yml index 49be997..d7ed94e 100644 --- a/.github/workflows/docker-image-version-tag.yml +++ b/.github/workflows/docker-image-version-tag.yml @@ -59,35 +59,6 @@ jobs: name: Build and Push Docker Image (App) needs: test if: success() - steps: - - name: Check out repo - uses: actions/checkout@v3 - - - name: Docker Login - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: axelander/openbudgeteer:pre-release - platforms: linux/arm64,linux/amd64 - - deploy-docker-api: - runs-on: ubuntu-latest - name: Build and Push Docker Image (API) - needs: test - if: success() steps: - name: Check out repo uses: actions/checkout@v3 @@ -110,4 +81,4 @@ jobs: context: . push: true tags: axelander/openbudgeteer:${{ github.ref_name }} - platforms: linux/arm64,linux/amd64 + platforms: linux/arm64,linux/amd64 \ No newline at end of file