Skip to content

Commit

Permalink
Trigger 1 workflow for each Docker image we build upon release (#81)
Browse files Browse the repository at this point in the history
* Updating GitHub Actions used to publish Docker images

* Trigger 2 separate workflows when publishing Docker images, one per target

* Deps upgrade
  • Loading branch information
detro authored Oct 9, 2023
1 parent 5922e3e commit f2abd1d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 46 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/crates.io-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }}

publish-hub_docker_com:
name: Publish to hub.docker.com
publish-hub_docker_com-linux_amd64:
name: Publish to hub.docker.com (linux/amd64)

needs:
- publish-crates_io
Expand All @@ -48,6 +48,23 @@ jobs:

with:
release-version: ${{ github.ref_name }}
target-platforms: linux/amd64

secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}

publish-hub_docker_com-linux_arm64:
name: Publish to hub.docker.com (linux/arm64)

needs:
- publish-crates_io

uses: ./.github/workflows/hub.docker.com-publish.yml

with:
release-version: ${{ github.ref_name }}
target-platforms: linux/arm64

secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/hub.docker.com-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ on:

jobs:
publish:
name: Build & Publish (${{ inputs.dockerhub-org }}/${{ inputs.dockerhub-imagename }}:${{ inputs.release-version }})
name: Build & Publish ${{ inputs.dockerhub-org }}/${{ inputs.dockerhub-imagename }}:${{ inputs.release-version }} for ${{ inputs.target-platforms }}

runs-on: ubuntu-latest

steps:

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.dockerhub-username }}
password: ${{ secrets.dockerhub-password }}

- name: Set-up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ inputs.target-platforms }}

- name: Build & Push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
platforms: ${{ inputs.target-platforms }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# vNEXT (????-??-??)

## Enhancements

* Reworked workflows that publish Docker image: triggering 1 dedicated workflow per target ([I#80](https://github.com/kafkesc/kommitted/issues/80))

# v0.2.1 (2023-10-04)

## Features
Expand Down
67 changes: 28 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ log = "0.4.20"
prometheus = "0.13.3"
regex = "1.9.6"
thiserror = "1.0.49"
tokio = { version = "1.32.0", features = ["rt", "rt-multi-thread", "time", "sync", "macros"] }
tokio = { version = "1.33.0", features = ["rt", "rt-multi-thread", "time", "sync", "macros"] }
tokio-util = "0.7.9"

[target.'cfg(unix)'.dependencies]
Expand Down

0 comments on commit f2abd1d

Please sign in to comment.