File tree 2 files changed +38
-35
lines changed
2 files changed +38
-35
lines changed Original file line number Diff line number Diff line change 1
- name : Auto-merge Dependabot PRs and Build Docker Image
1
+ name : Auto-merge Dependabot PRs
2
2
3
3
on :
4
- pull_request :
5
- branches : [ master ]
6
4
pull_request_target :
7
5
branches : [ master ]
6
+ types : [opened, synchronize]
8
7
9
8
jobs :
10
9
auto-merge :
28
27
run : gh pr merge --auto --merge "$PR_URL"
29
28
env :
30
29
PR_URL : ${{github.event.pull_request.html_url}}
31
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
32
-
33
- build-and-push :
34
- needs : auto-merge
35
- runs-on : ubuntu-latest
36
- if : github.event.pull_request.merged == true && github.actor == 'dependabot[bot]'
37
-
38
- steps :
39
- - name : Checkout code
40
- uses : actions/checkout@v4
41
- with :
42
- ref : master
43
-
44
- - name : Set up Docker Buildx
45
- uses : docker/setup-buildx-action@v3
46
-
47
- - name : Login to DockerHub
48
- uses : docker/login-action@v3
49
- with :
50
- username : ${{ secrets.DOCKERHUB_USERNAME }}
51
- password : ${{ secrets.DOCKERHUB_TOKEN }}
52
-
53
- - name : Build and push Docker image
54
- uses : docker/build-push-action@v5
55
- with :
56
- push : true
57
- context : .
58
- tags : |
59
- lvthillo/python-flask-docker:latest
60
- lvthillo/python-flask-docker:${{ github.sha }}
61
- cache-from : type=gha
62
- cache-to : type=gha,mode=max
30
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change
1
+ name : Build and Push Docker Image
2
+
3
+ on :
4
+ pull_request :
5
+ branches : [ master ]
6
+ types : [closed]
7
+
8
+ jobs :
9
+ build-and-push :
10
+ runs-on : ubuntu-latest
11
+ if : github.event.pull_request.merged == true && github.event.pull_request.user.login == 'dependabot[bot]'
12
+
13
+ steps :
14
+ - name : Checkout code
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Set up Docker Buildx
18
+ uses : docker/setup-buildx-action@v3
19
+
20
+ - name : Login to DockerHub
21
+ uses : docker/login-action@v3
22
+ with :
23
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
24
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
25
+
26
+ - name : Build and push Docker image
27
+ uses : docker/build-push-action@v5
28
+ with :
29
+ push : true
30
+ context : .
31
+ tags : |
32
+ lvthillo/python-flask-docker:latest
33
+ lvthillo/python-flask-docker:${{ github.sha }}
34
+ cache-from : type=gha
35
+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments