-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (37 loc) · 1.32 KB
/
trigger-test-docker-build.yml
File metadata and controls
41 lines (37 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Build and Test Docker Image
on:
pull_request:
branches: ["main"]
jobs:
should-test-docker-build:
permissions:
contents: read
pull-requests: read
name: Check if `test_docker_build` should run
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check if Dockerfile or docker-build action have changed
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: docker-changes
with:
filters: |
docker:
- 'Dockerfile'
- '.dockerignore'
workflow:
- ./.github/actions/docker-build/action.yml
- ./.github/workflows/build-test-docker.yml
outputs:
docker: ${{ steps.docker-changes.outputs.docker }}
workflow: ${{ steps.docker-changes.outputs.workflow }}
trigger-test-docker-build:
needs: [should-test-docker-build]
name: Trigger test Docker build
if: (needs.should-test-docker-build.outputs.workflow == 'true' || needs.should-test-docker-build.outputs.docker == 'true')
uses: ./.github/workflows/build-test-docker.yml
with:
image-tag: "pr-${{ github.event.pull_request.number }}"