|
16 | 16 | required: true
|
17 | 17 | type: string
|
18 | 18 |
|
19 |
| -jobs: |
20 |
| - build: |
21 |
| - runs-on: ${{ inputs.platform == 'linux/arm64' && 'macos-latest' || 'ubuntu-latest' }} |
22 |
| - steps: |
23 |
| - - |
24 |
| - name: Prepare Platform Environment |
25 |
| - run: | |
26 |
| - echo "PLATFORM_PAIR=${{ inputs.platform//\//- }}" >> $GITHUB_ENV |
27 |
| - - |
28 |
| - name: Checkout |
29 |
| - uses: actions/checkout@v4 |
30 |
| - - |
31 |
| - name: Docker meta |
32 |
| - id: meta |
33 |
| - uses: docker/metadata-action@v5 |
34 |
| - with: |
35 |
| - images: ${{ inputs.registry_image }} |
36 |
| - - |
37 |
| - name: Set up QEMU |
38 |
| - uses: docker/setup-qemu-action@v3 |
39 |
| - - |
40 |
| - name: Set up Docker Buildx |
41 |
| - uses: docker/setup-buildx-action@v3 |
42 |
| - - |
43 |
| - name: Login to Docker Hub |
44 |
| - uses: docker/login-action@v3 |
45 |
| - with: |
46 |
| - username: ${{ secrets.DOCKERHUB_USERNAME }} |
47 |
| - password: ${{ secrets.DOCKERHUB_TOKEN }} |
48 |
| - - |
49 |
| - name: Build and push by digest |
50 |
| - id: build |
51 |
| - uses: docker/build-push-action@v5 |
52 |
| - with: |
53 |
| - context: . |
54 |
| - file: ./deployments/Dockerfile |
55 |
| - platforms: ${{ inputs.platform }} |
56 |
| - labels: ${{ steps.meta.outputs.labels }} |
57 |
| - outputs: type=image,name=${{ inputs.registry_image }},push-by-digest=true,name-canonical=true,push=true |
58 |
| - build-args: | |
59 |
| - RUNTIME=${{ inputs.runtime }} |
60 |
| - BUILDPACK=${{ inputs.buildpack }} |
61 |
| - - |
62 |
| - name: Export digest |
63 |
| - run: | |
64 |
| - mkdir -p /tmp/digests |
65 |
| - digest="${{ steps.build.outputs.digest }}" |
66 |
| - touch "/tmp/digests/${digest#sha256:}" |
67 |
| - - |
68 |
| - name: Upload digest |
69 |
| - uses: actions/upload-artifact@v4 |
70 |
| - with: |
71 |
| - name: digests-${{ env.PLATFORM_PAIR }} |
72 |
| - path: /tmp/digests/* |
73 |
| - if-no-files-found: error |
74 |
| - retention-days: 1 |
| 19 | +runs: |
| 20 | + using: composite |
| 21 | + |
| 22 | + steps: |
| 23 | + - |
| 24 | + name: Prepare Platform Environment |
| 25 | + run: | |
| 26 | + echo "PLATFORM_PAIR=${{ inputs.platform//\//- }}" >> $GITHUB_ENV |
| 27 | + - |
| 28 | + name: Checkout |
| 29 | + uses: actions/checkout@v4 |
| 30 | + - |
| 31 | + name: Docker meta |
| 32 | + id: meta |
| 33 | + uses: docker/metadata-action@v5 |
| 34 | + with: |
| 35 | + images: ${{ inputs.registry_image }} |
| 36 | + - |
| 37 | + name: Set up QEMU |
| 38 | + uses: docker/setup-qemu-action@v3 |
| 39 | + - |
| 40 | + name: Set up Docker Buildx |
| 41 | + uses: docker/setup-buildx-action@v3 |
| 42 | + - |
| 43 | + name: Login to Docker Hub |
| 44 | + uses: docker/login-action@v3 |
| 45 | + with: |
| 46 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 47 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 48 | + - |
| 49 | + name: Build and push by digest |
| 50 | + id: build |
| 51 | + uses: docker/build-push-action@v5 |
| 52 | + with: |
| 53 | + context: . |
| 54 | + file: ./deployments/Dockerfile |
| 55 | + platforms: ${{ inputs.platform }} |
| 56 | + labels: ${{ steps.meta.outputs.labels }} |
| 57 | + outputs: type=image,name=${{ inputs.registry_image }},push-by-digest=true,name-canonical=true,push=true |
| 58 | + build-args: | |
| 59 | + RUNTIME=${{ inputs.runtime }} |
| 60 | + BUILDPACK=${{ inputs.buildpack }} |
| 61 | + - |
| 62 | + name: Export digest |
| 63 | + run: | |
| 64 | + mkdir -p /tmp/digests |
| 65 | + digest="${{ steps.build.outputs.digest }}" |
| 66 | + touch "/tmp/digests/${digest#sha256:}" |
| 67 | + - |
| 68 | + name: Upload digest |
| 69 | + uses: actions/upload-artifact@v4 |
| 70 | + with: |
| 71 | + name: digests-${{ env.PLATFORM_PAIR }} |
| 72 | + path: /tmp/digests/* |
| 73 | + if-no-files-found: error |
| 74 | + retention-days: 1 |
0 commit comments