Skip to content

Commit 00e72dd

Browse files
authored
adding only run push on main branch (#246)
Signed-off-by: Paige Patton <[email protected]>
1 parent e52f699 commit 00e72dd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/docker-image.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,31 @@ on:
99

1010
push:
1111
branches: ['main']
12+
pull_request:
13+
1214

1315
jobs:
1416
build:
1517
runs-on: ubuntu-latest
1618
steps:
17-
- name: Login in quay
18-
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
19-
env:
20-
QUAY_USER: ${{ secrets.QUAY_USERNAME }}
21-
QUAY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
2219
- name: Check out code
2320
uses: actions/checkout@main
2421
- name: Add krknctl metadata to Dockerfiles
2522
run: |
2623
bash build.sh
2724
- name: Build the Docker images
2825
run: docker compose build --parallel
26+
- name: Login in quay
27+
if: ${{ github.ref == 'refs/heads/main' }}
28+
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
29+
env:
30+
QUAY_USER: ${{ secrets.QUAY_USERNAME }}
31+
QUAY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
2932
- name: Push the Docker images
33+
if: ${{ github.ref == 'refs/heads/main' }}
3034
run: docker compose push
3135
- name: Call repo lambda
36+
if: ${{ github.ref == 'refs/heads/main'}}
3237
run: |
3338
curl --location --request POST '${{ secrets.LAMBDA_URL }}' --header 'Authorization: Bearer ${{ secrets.LAMBDA_TOKEN }}'
3439

0 commit comments

Comments
 (0)