Skip to content

Commit 60fda0a

Browse files
committed
CI: Build docker on PR and push when tags are created
1 parent ec8f995 commit 60fda0a

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
tags:
6+
- "mr*"
7+
pull_request:
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v3
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Docker meta
19+
id: meta
20+
uses: docker/metadata-action@v5
21+
with:
22+
images: |
23+
sipwise/rtpengine
24+
tags: |
25+
type=match,pattern=mr(.*),group=1
26+
27+
- name: Login to Docker Hub
28+
uses: docker/login-action@v3
29+
if: ${{ github.event_name != 'pull_request' }}
30+
with:
31+
username: ${{ vars.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v6
36+
with:
37+
platforms: linux/amd64,linux/arm64
38+
push: ${{ github.event_name != 'pull_request' }}
39+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)