|
1 | 1 | ---
|
2 |
| -name: Docker |
3 |
| -on: # yamllint disable-line rule:truthy |
4 |
| - push |
5 |
| - |
6 |
| -jobs: |
7 |
| - |
8 |
| - build_and_push_docker_image: |
9 |
| - name: Build and push image |
10 |
| - runs-on: ubuntu-22.04 |
11 |
| - steps: |
12 |
| - - uses: actions/checkout@v4 |
13 |
| - - name: Set up QEMU |
14 |
| - uses: docker/setup-qemu-action@v3 |
15 |
| - - name: Set up Docker Buildx |
16 |
| - uses: docker/setup-buildx-action@v3 |
17 |
| - - name: Login to Docker Hub |
18 |
| - uses: docker/login-action@v3 |
19 |
| - with: |
20 |
| - username: ${{ secrets.DOCKER_USERNAME }} |
21 |
| - password: ${{ secrets.DOCKER_PASSWORD }} |
22 |
| - - name: Docker meta |
23 |
| - id: meta |
24 |
| - uses: docker/metadata-action@v5 |
25 |
| - with: |
26 |
| - images: agilepathway/pull-request-label-checker |
27 |
| - tags: | |
28 |
| - type=ref,event=branch |
29 |
| - type=sha |
30 |
| - - name: Build and push Docker image |
31 |
| - # Skip running on forks or Dependabot since neither has access to secrets |
32 |
| - if: | |
33 |
| - (github.repository == 'agilepathway/label-checker') && |
34 |
| - (github.actor!= 'dependabot[bot]') && |
35 |
| - (contains(github.head_ref, 'dependabot/github_actions/') == false) |
36 |
| - uses: docker/build-push-action@v6 |
37 |
| - with: |
38 |
| - tags: ${{ steps.meta.outputs.tags }} |
39 |
| - push: true |
40 |
| - platforms: linux/amd64,linux/arm64 |
| 2 | + name: Docker |
| 3 | + on: # yamllint disable-line rule:truthy |
| 4 | + push |
| 5 | + |
| 6 | + jobs: |
| 7 | + |
| 8 | + build_and_push_docker_image: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + include: |
| 12 | + - os: "ubuntu-24.04" |
| 13 | + image: "linux/amd64" |
| 14 | + - os: "ubuntu-24.04-arm" |
| 15 | + image: "linux/arm64" |
| 16 | + |
| 17 | + name: Build and push image |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - name: Set up Docker Buildx |
| 22 | + id: buildx |
| 23 | + uses: docker/setup-buildx-action@v3 |
| 24 | + - name: Login to Docker Hub |
| 25 | + uses: docker/login-action@v3 |
| 26 | + with: |
| 27 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 28 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 29 | + - name: Inspect builder |
| 30 | + run: | |
| 31 | + echo "Name: ${{ steps.buildx.outputs.name }}" |
| 32 | + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" |
| 33 | + echo "Status: ${{ steps.buildx.outputs.status }}" |
| 34 | + echo "Flags: ${{ steps.buildx.outputs.flags }}" |
| 35 | + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" |
| 36 | + - name: Docker meta |
| 37 | + id: meta |
| 38 | + uses: docker/metadata-action@v5 |
| 39 | + with: |
| 40 | + images: agilepathway/pull-request-label-checker |
| 41 | + tags: | |
| 42 | + type=ref,event=branch |
| 43 | + type=sha |
| 44 | + - name: Build and push Docker image |
| 45 | + # Skip running on forks or Dependabot since neither has access to secrets |
| 46 | + if: | |
| 47 | + (github.repository == 'agilepathway/label-checker') && |
| 48 | + (github.actor!= 'dependabot[bot]') && |
| 49 | + (contains(github.head_ref, 'dependabot/github_actions/') == false) |
| 50 | + uses: docker/build-push-action@v6 |
| 51 | + with: |
| 52 | + tags: ${{ steps.meta.outputs.tags }} |
| 53 | + push: true |
| 54 | + platforms: ${{ matrix.image }} |
0 commit comments