-
Notifications
You must be signed in to change notification settings - Fork 5.5k
41 lines (38 loc) · 1.13 KB
/
test_docker_build.yml
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: Test Docker images (scheduled)
on:
pull_request:
paths:
# Run only when DockerFile files are modified
- "docker/**"
concurrency:
group: docker-image-builds
cancel-in-progress: false
jobs:
name: "Build all modified docker images"
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Check out code
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@3f54ebb830831fc121d3263c1857cfbdc310cdb9 #v42
with:
files: docker/**
- name: Run step if only the files listed above change
if: steps.changed-files.outputs.only_changed == 'true'
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files}}
run: |
for file in ${CHANGED_FILES}; do
echo "$file was changed"
done
- name: Build Docker images
strategy:
matrix:
docker-file: ${{ steps.changed-files.outputs.all_changed_files}}
uses: docker/build-push-action@v4
with:
context: ${{ matrix.docker-file }}
push: False