From fc5bd5b1cbeaae0a29bb3e0b21814b6140a5f01f Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:52:15 +0200 Subject: [PATCH 1/9] Release dev docker images --- .github/workflows/release-docker-images.yml | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/release-docker-images.yml diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml new file mode 100644 index 0000000..dbec9f2 --- /dev/null +++ b/.github/workflows/release-docker-images.yml @@ -0,0 +1,25 @@ +name: Release dev image +on: + push: + branches: + - 'master' +jobs: + build_and_release: + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v2 + - name: Setup Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:dev From 35c77ebf7aa6600face6ae77b4338704cfbf9ed7 Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:53:42 +0200 Subject: [PATCH 2/9] gh actions: fix typo in main branch --- .github/workflows/release-docker-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index dbec9f2..496e757 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -2,7 +2,7 @@ name: Release dev image on: push: branches: - - 'master' + - 'main' jobs: build_and_release: runs-on: ubuntu-latest From 80707bf7551aaa2571b6fde0698dd209d8625aaf Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:05:40 +0200 Subject: [PATCH 3/9] gh actions: cross compile to arm64 --- .github/workflows/release-docker-images.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index 496e757..eef4a06 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -9,17 +9,20 @@ jobs: steps: - name: Clone repo uses: actions/checkout@v2 + - name: Setup QEMU + uses: docker/setup-qemu-action@v2 - name: Setup Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build image and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: . push: true + platforms: linux/amd64,linux/arm64 tags: ghcr.io/${{ github.repository }}:dev From d16bb8bc13cbe7a0e36f38451690d7d1f7171c1c Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:24:01 +0200 Subject: [PATCH 4/9] gh actions: allow for custom tag --- .github/workflows/release-docker-images.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index eef4a06..1092b14 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -3,6 +3,15 @@ on: push: branches: - 'main' + workflow_dispatch: + inputs: + imageTag: + description: 'Docker Image tag' + required: true + default: 'latest' + type: string +env: + DEV_TAG: dev jobs: build_and_release: runs-on: ubuntu-latest @@ -21,8 +30,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build image and push uses: docker/build-push-action@v3 + env: + IMAGE_TAG: ${{ github.event_name != 'workflow_dispatch' && env.imageTag || inputs.build_id }} with: context: . push: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/${{ github.repository }}:dev + tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} From 2978e0e02a20e67c168027e3bb28d7867cfa7799 Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:26:09 +0200 Subject: [PATCH 5/9] gh actions: fix env variable --- .github/workflows/release-docker-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index 1092b14..0684b41 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -36,4 +36,4 @@ jobs: context: . push: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} + tags: ghcr.io/${{ github.repository }}:${IMAGE_TAG} From f1b796587e782b2340814fab067d0be3515e7d33 Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:29:39 +0200 Subject: [PATCH 6/9] gh actions: fix tag --- .github/workflows/release-docker-images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index 0684b41..51c4b80 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -31,9 +31,9 @@ jobs: - name: Build image and push uses: docker/build-push-action@v3 env: - IMAGE_TAG: ${{ github.event_name != 'workflow_dispatch' && env.imageTag || inputs.build_id }} + IMAGE_TAG: ${{ github.event_name != 'workflow_dispatch' && inputs.build_id || env.imageTag }} with: context: . push: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/${{ github.repository }}:${IMAGE_TAG} + tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} From efb163d5bc6337b8c95b1cc7734b50a2c92ad60e Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:36:21 +0200 Subject: [PATCH 7/9] gh actions: fix image tag --- .github/workflows/release-docker-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index 51c4b80..545e947 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -31,7 +31,7 @@ jobs: - name: Build image and push uses: docker/build-push-action@v3 env: - IMAGE_TAG: ${{ github.event_name != 'workflow_dispatch' && inputs.build_id || env.imageTag }} + IMAGE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.imageTag || env.DEV_TAG }} with: context: . push: true From 1b9590a79b2025e77b04f29a276037783ba326bf Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:37:49 +0200 Subject: [PATCH 8/9] github actions: change action name --- .github/workflows/release-docker-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index 545e947..5a8b263 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -1,4 +1,4 @@ -name: Release dev image +name: Release docker image on: push: branches: From 1ec77cae35657fe320782c814b0b7e2095d409e4 Mon Sep 17 00:00:00 2001 From: beelux <75177432+beelux@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:40:49 +0200 Subject: [PATCH 9/9] gh actions: cancel previous in-progress build --- .github/workflows/release-docker-images.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-docker-images.yml b/.github/workflows/release-docker-images.yml index 5a8b263..6622506 100644 --- a/.github/workflows/release-docker-images.yml +++ b/.github/workflows/release-docker-images.yml @@ -12,6 +12,9 @@ on: type: string env: DEV_TAG: dev +concurrency: + group: ${{ github.event_name }} + cancel-in-progress: true jobs: build_and_release: runs-on: ubuntu-latest