Skip to content

Commit 71ebeb9

Browse files
committed
Add Docker publish job to release workflow
1 parent 3bc6217 commit 71ebeb9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,44 @@ jobs:
6666
--all-features
6767
--verbose
6868
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}
69+
70+
docker-publish:
71+
needs: upload-assets
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Set up QEMU
78+
uses: docker/setup-qemu-action@v3
79+
80+
- name: Set up Docker Buildx
81+
uses: docker/setup-buildx-action@v3
82+
83+
- name: Login to Docker Hub
84+
uses: docker/login-action@v3
85+
with:
86+
username: ${{ secrets.DOCKERHUB_USERNAME }}
87+
password: ${{ secrets.DOCKERHUB_TOKEN }}
88+
89+
- name: Extract metadata (tags, labels) for Docker
90+
id: meta
91+
uses: docker/metadata-action@v5
92+
with:
93+
images: docker.io/bgpkit/monocle
94+
tags: |
95+
type=semver,pattern={{version}}
96+
type=semver,pattern={{major}}.{{minor}}
97+
type=semver,pattern={{major}}
98+
type=raw,value=latest
99+
100+
- name: Build and push
101+
uses: docker/build-push-action@v6
102+
with:
103+
context: .
104+
platforms: linux/amd64,linux/arm64
105+
push: true
106+
tags: ${{ steps.meta.outputs.tags }}
107+
labels: ${{ steps.meta.outputs.labels }}
108+
cache-from: type=gha
109+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)