Skip to content

Commit 217e934

Browse files
committed
Fix docker CI for PRs
1 parent 515e365 commit 217e934

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Image Build for PRs
2+
3+
# Run on every push to main + weekly, Sunday @ midnight
4+
# to keep the image fresh
5+
on:
6+
pull_request:
7+
types: [opened, reopened, sychronize]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Docker metadata
17+
id: meta
18+
uses: docker/metadata-action@v4
19+
with:
20+
images: facebook/whatsapp_proxy
21+
tags: |
22+
type=raw,value={{date 'YYYYMMDD'}}
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v2
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v2
29+
30+
- name: Build PR
31+
uses: docker/build-push-action@v3
32+
with:
33+
context: ./proxy
34+
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
35+
push: false
36+
tags: |
37+
${{ steps.meta.outputs.tags }}
38+
facebook/whatsapp_proxy:latest

.github/workflows/docker-image.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Image CI
1+
name: Docker Build and PR for Main
22

33
# Run on every push to main + weekly, Sunday @ midnight
44
# to keep the image fresh
@@ -7,9 +7,6 @@ on:
77
branches: [ "main" ]
88
schedule:
99
- cron: "0 0 * * 0"
10-
# On pull-requests only a build is run, not a push to Docker Hub
11-
pull_request:
12-
types: [opened, reopened, synchronize]
1310

1411
jobs:
1512

@@ -19,7 +16,7 @@ jobs:
1916

2017
steps:
2118
- uses: actions/checkout@v3
22-
19+
2320
- name: Docker metadata
2421
id: meta
2522
uses: docker/metadata-action@v4
@@ -33,13 +30,13 @@ jobs:
3330

3431
- name: Set up Docker Buildx
3532
uses: docker/setup-buildx-action@v2
36-
33+
3734
- name: Login to dockerhub
3835
uses: docker/login-action@v2
3936
with:
4037
username: ${{ secrets.DOCKERHUB_USERNAME }}
4138
password: ${{ secrets.DOCKERHUB_TOKEN }}
42-
39+
4340
- name: Build and push
4441
uses: docker/build-push-action@v3
4542
with:
@@ -49,4 +46,3 @@ jobs:
4946
tags: |
5047
${{ steps.meta.outputs.tags }}
5148
facebook/whatsapp_proxy:latest
52-

0 commit comments

Comments
 (0)