Skip to content

Commit

Permalink
ci(publish): build and publish image to dockerhub on release
Browse files Browse the repository at this point in the history
Signed-off-by: Radek Ježek <[email protected]>
  • Loading branch information
jezekra1 committed Oct 17, 2024
1 parent 815b2e4 commit c4304ff
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-release-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: build and publish release image

on:
# On release events (also when a published release is converted from/to prerelease), push all patterns
release:
types: [released, prereleased]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

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

- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Build and push bee-api image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
iambeeagent/bee-api:latest
iambeeagent/bee-api:${{ steps.get_version.outputs.VERSION }}
cache-from: type=registry,ref=iambeeagent/bee-api:buildcache
cache-to: type=registry,ref=iambeeagent/bee-api:buildcache,mode=max

0 comments on commit c4304ff

Please sign in to comment.