|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | changes: |
12 | | - name: Dockerfile changes |
| 12 | + name: Dockerfile Changes |
13 | 13 | runs-on: ubuntu-latest |
14 | 14 | outputs: |
15 | 15 | dockerfiles: ${{ steps.filter.outputs.dockerfiles_files }} |
16 | 16 | dockerfiles_changed: ${{ steps.filter.outputs.dockerfiles }} |
17 | 17 | steps: |
18 | | - - name: Checkout |
| 18 | + - name: Checkout repository |
19 | 19 | uses: actions/checkout@v4 |
20 | | - - uses: dorny/paths-filter@v3 |
| 20 | + |
| 21 | + - name: Filter Dockerfile changes |
| 22 | + uses: dorny/paths-filter@v3 |
21 | 23 | id: filter |
22 | 24 | with: |
23 | 25 | list-files: json |
24 | 26 | filters: | |
25 | 27 | dockerfiles: |
26 | 28 | - added|modified: 'dockerfiles/*.Dockerfile' |
| 29 | +
|
27 | 30 | - name: Generate Markdown Summary |
28 | | - run: | |
29 | | - echo New/modified Dockerfiles: ${{ steps.filter.outputs.dockerfiles_files }} >> $GITHUB_STEP_SUMMARY |
| 31 | + run: echo "New/modified Dockerfiles: ${{ steps.filter.outputs.dockerfiles_files }}" >> $GITHUB_STEP_SUMMARY |
30 | 32 |
|
31 | 33 | ghcr: |
32 | | - needs: [changes] |
| 34 | + needs: changes |
33 | 35 | if: ${{ needs.changes.outputs.dockerfiles_changed == 'true' }} |
34 | 36 | runs-on: ubuntu-latest |
35 | 37 | permissions: |
36 | 38 | contents: read |
37 | 39 | packages: write |
38 | 40 | strategy: |
39 | | - matrix: |
| 41 | + matrix: |
40 | 42 | image: ${{ fromJson(needs.changes.outputs.dockerfiles) }} |
41 | 43 | steps: |
42 | | - - name: checkout |
| 44 | + - name: Checkout repository |
43 | 45 | uses: actions/checkout@v4 |
44 | 46 |
|
45 | | - - name: GHCR Login |
46 | | - uses: docker/login-action@v2 |
| 47 | + - name: Set up QEMU for cross-platform builds |
| 48 | + uses: docker/setup-qemu-action@v3 |
| 49 | + |
| 50 | + - name: Set up Docker Buildx |
| 51 | + uses: docker/setup-buildx-action@v3 |
| 52 | + |
| 53 | + - name: Login to GHCR |
| 54 | + uses: docker/login-action@v3 |
47 | 55 | with: |
48 | 56 | registry: ghcr.io |
49 | 57 | username: ${{ github.actor }} |
50 | 58 | password: ${{ secrets.GITHUB_TOKEN }} |
51 | | - |
| 59 | + |
52 | 60 | - id: image-tag # example output: "ghcr.io/kestra-io/pydata:latest" |
53 | 61 | run: | |
54 | | - export IMAGE=$(basename ${{ matrix.image }} .Dockerfile) |
| 62 | + IMAGE=$(basename ${{ matrix.image }} .Dockerfile) |
55 | 63 | echo "image_url=ghcr.io/kestra-io/$IMAGE:latest" >> $GITHUB_OUTPUT |
56 | 64 | echo "file=${{ matrix.image }}" >> $GITHUB_OUTPUT |
57 | | - |
| 65 | +
|
58 | 66 | - name: Build and push Docker image |
59 | 67 | uses: docker/build-push-action@v4 |
60 | 68 | with: |
61 | 69 | context: . |
62 | 70 | push: true |
63 | 71 | tags: ${{ steps.image-tag.outputs.image_url }} |
64 | 72 | file: ${{ steps.image-tag.outputs.file }} |
| 73 | + platforms: linux/amd64,linux/arm64 |
0 commit comments