From 00b2504a0b0a68d10b30a2bc1c80b914af2c49fc Mon Sep 17 00:00:00 2001 From: Max Winterstein Date: Tue, 26 Nov 2024 23:32:56 +0100 Subject: [PATCH] Rework release flow --- .../docker-buld-push-as-testing.yaml | 2 +- .github/workflows/main.yml | 15 +++------ .github/workflows/release.yaml | 32 +++++++++++++++++++ 3 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/docker-buld-push-as-testing.yaml b/.github/workflows/docker-buld-push-as-testing.yaml index 136590e..2ac76f9 100644 --- a/.github/workflows/docker-buld-push-as-testing.yaml +++ b/.github/workflows/docker-buld-push-as-testing.yaml @@ -1,4 +1,4 @@ -name: Build docker images - and push as test +name: Build docker images - and push as test - manual on: # Allows you to run this workflow manually from the Actions tab diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4f0fa8..3b77dcf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,9 @@ -name: build-and-push +name: build-and-push-master on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - inputs: - version: - description: "Image Tag" - required: true - + push: + branches: + - main jobs: build-and-push: runs-on: ubuntu-latest @@ -31,5 +27,4 @@ jobs: platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true tags: | - maxwinterstein/toogoodtogo-ha-mqtt-bridge:${{ github.event.inputs.version }} - maxwinterstein/toogoodtogo-ha-mqtt-bridge:latest + maxwinterstein/toogoodtogo-ha-mqtt-bridge:master diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..136590e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +name: Build docker images - and push as test + +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch the entire history to include the .git directory + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + tags: | + maxwinterstein/toogoodtogo-ha-mqtt-bridge:test