Skip to content

Commit d8d17a0

Browse files
committed
build docker in PRs
1 parent 9aa5f10 commit d8d17a0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/build_application_docker.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ on:
33
workflow_run:
44
workflows:
55
- 'Publish Platform'
6-
- 'Publish Platform Hotfix'
76
types:
87
- completed
8+
pull_request:
99

1010
# concurrency:
1111
# group: ${{ github.workflow }}
@@ -66,13 +66,21 @@ jobs:
6666
tags: |
6767
type=raw,value=${{ env.BUILD_VERSION }}
6868
${{ contains(env.COMMIT_NAME, '[release]') && 'type=raw,value=latest' || '' }}
69+
- name: Check if workflow triggered by pull request
70+
id: pull_request
71+
run: |
72+
if [ -n "${{ github.event.pull_request.number }}" ]; then
73+
echo "pull_request=true" >> "$GITHUB_OUTPUT"
74+
else
75+
echo "pull_request=false" >> "$GITHUB_OUTPUT"
76+
fi
6977
- name: Build and push Docker image
7078
uses: docker/build-push-action@v6
7179
with:
7280
build-args: |
7381
app_version=${{ env.BUILD_VERSION }}
7482
context: .
75-
push: true
83+
push: ${{ steps.pull_request.outputs.pull_request == 'true' && false || true }}
7684
tags: ${{ steps.meta.outputs.tags }}
7785
labels: ${{ steps.meta.outputs.labels }}
7886
platforms: linux/amd64,linux/arm64

.github/workflows/e2e_build_application_docker.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
workflow_run:
44
workflows:
55
- 'Publish Platform'
6-
- 'Publish Platform Hotfix'
76
types:
87
- completed
98

0 commit comments

Comments
 (0)