Skip to content

Commit 3e31cba

Browse files
committed
feat(pfd): switch to two workflows
1 parent 686ec9a commit 3e31cba

File tree

2 files changed

+38
-35
lines changed

2 files changed

+38
-35
lines changed
+3-35
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: Auto-merge Dependabot PRs and Build Docker Image
1+
name: Auto-merge Dependabot PRs
22

33
on:
4-
pull_request:
5-
branches: [ master ]
64
pull_request_target:
75
branches: [ master ]
6+
types: [opened, synchronize]
87

98
jobs:
109
auto-merge:
@@ -28,35 +27,4 @@ jobs:
2827
run: gh pr merge --auto --merge "$PR_URL"
2928
env:
3029
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}}
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

0 commit comments

Comments
 (0)