|
18 | 18 | REGISTRY_IMAGE: hackmdio/hackmd |
19 | 19 |
|
20 | 20 | jobs: |
21 | | - build: |
| 21 | + build-amd64: |
22 | 22 | runs-on: ubuntu-latest |
23 | | - strategy: |
24 | | - fail-fast: false |
25 | | - matrix: |
26 | | - platform: |
27 | | - - linux/amd64 |
28 | | - - linux/arm64 |
29 | 23 | steps: |
30 | 24 | - |
31 | | - name: Prepare |
32 | | - run: | |
33 | | - platform=${{ matrix.platform }} |
34 | | - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV |
35 | | - - |
36 | | - name: Checkout |
37 | | - uses: actions/checkout@v4 |
| 25 | + name: Set Platform Variable |
| 26 | + run: echo "PLATFORM_PAIR=linux-amd64" >> $GITHUB_ENV |
38 | 27 | - |
39 | | - name: Docker meta |
40 | | - id: meta |
41 | | - uses: docker/metadata-action@v5 |
| 28 | + name: Execute Build Steps |
| 29 | + uses: ./.github/workflows/build-steps.yml |
42 | 30 | with: |
43 | | - images: ${{ env.REGISTRY_IMAGE }} |
44 | | - - |
45 | | - name: Set up QEMU |
46 | | - uses: docker/setup-qemu-action@v3 |
47 | | - - |
48 | | - name: Set up Docker Buildx |
49 | | - uses: docker/setup-buildx-action@v3 |
50 | | - - |
51 | | - name: Login to Docker Hub |
52 | | - uses: docker/login-action@v3 |
53 | | - with: |
54 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
55 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
56 | | - - |
57 | | - name: Build and push by digest |
58 | | - id: build |
59 | | - uses: docker/build-push-action@v5 |
60 | | - with: |
61 | | - context: . |
62 | | - file: ./deployments/Dockerfile |
63 | | - platforms: ${{ matrix.platform }} |
64 | | - labels: ${{ steps.meta.outputs.labels }} |
65 | | - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true |
66 | | - build-args: | |
67 | | - RUNTIME=${{ github.event.inputs.runtime || 'hackmdio/runtime:16.20.2-35fe7e39' }} |
68 | | - BUILDPACK=${{ github.event.inputs.buildpack || 'hackmdio/buildpack:16.20.2-35fe7e39' }} |
| 31 | + platform: linux/amd64 |
| 32 | + |
| 33 | + build-arm64: |
| 34 | + runs-on: macos-latest |
| 35 | + steps: |
69 | 36 | - |
70 | | - name: Export digest |
71 | | - run: | |
72 | | - mkdir -p /tmp/digests |
73 | | - digest="${{ steps.build.outputs.digest }}" |
74 | | - touch "/tmp/digests/${digest#sha256:}" |
| 37 | + name: Set Platform Variable |
| 38 | + run: echo "PLATFORM_PAIR=linux-arm64" >> $GITHUB_ENV |
75 | 39 | - |
76 | | - name: Upload digest |
77 | | - uses: actions/upload-artifact@v4 |
| 40 | + name: Execute Build Steps |
| 41 | + uses: ./.github/workflows/build-steps.yml |
78 | 42 | with: |
79 | | - name: digests-${{ env.PLATFORM_PAIR }} |
80 | | - path: /tmp/digests/* |
81 | | - if-no-files-found: error |
82 | | - retention-days: 1 |
| 43 | + platform: linux/arm64 |
83 | 44 |
|
84 | 45 | merge: |
85 | 46 | runs-on: ubuntu-latest |
86 | 47 | needs: |
87 | | - - build |
| 48 | + - build-amd64 |
| 49 | + - build-arm64 |
88 | 50 | steps: |
89 | 51 | - |
90 | 52 | name: Download digests |
|
0 commit comments