|
32 | 32 | IMAGE_TAGS: | |
33 | 33 | type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} |
34 | 34 | type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }} |
| 35 | + type=raw,value={{branch}}-ubuntu-arm |
35 | 36 | type=ref,event=tag |
36 | 37 | type=semver,pattern=v{{major}}-latest |
37 | 38 | # Define default tag "flavor" for docker/metadata-action per |
@@ -89,13 +90,16 @@ jobs: |
89 | 90 | # Ensure this job never runs on forked repos. It's only executed for 'grokability/snipe-it' |
90 | 91 | if: github.repository == 'grokability/snipe-it' |
91 | 92 | runs-on: ubuntu-latest |
| 93 | + outputs: |
| 94 | + tags: ${{ steps.gen_output.outputs.tags }} |
92 | 95 | env: |
93 | 96 | # Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action) |
94 | 97 | # For a new commit on default branch (master), use the literal tag 'latest' on Docker image. |
95 | 98 | # For a new commit on other branches, use the branch name as the tag for Docker image. |
96 | 99 | # For a new tag, copy that tag name as the tag for Docker image. |
97 | 100 | IMAGE_TAGS: | |
98 | 101 | type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} |
| 102 | + type=raw,value={{branch}}-ubuntu-intel |
99 | 103 | type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }} |
100 | 104 | type=ref,event=tag |
101 | 105 | type=semver,pattern=v{{major}}-latest |
@@ -150,3 +154,29 @@ jobs: |
150 | 154 | # Use tags / labels provided by 'docker/metadata-action' above |
151 | 155 | tags: ${{ steps.meta_build.outputs.tags }} |
152 | 156 | labels: ${{ steps.meta_build.outputs.labels }} |
| 157 | + - name: Generate output |
| 158 | + id: gen_output |
| 159 | + run: | |
| 160 | + echo "tags=${{ steps.meta_build.outputs.tags }}" >> "$GITHUB_OUTPUT" |
| 161 | + combinator: |
| 162 | + name: combine multiple arches into a single "image" |
| 163 | + needs: [docker-ubuntu-intel, docker-ubuntu-arm] |
| 164 | + runs-on: ubuntu-latest |
| 165 | + steps: |
| 166 | + # https://github.com/docker/login-action |
| 167 | + - name: Login to DockerHub |
| 168 | + # Only login if not a PR, as PRs only trigger a Docker build and not a push |
| 169 | + if: github.event_name != 'pull_request' |
| 170 | + uses: docker/login-action@v3 |
| 171 | + with: |
| 172 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 173 | + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} |
| 174 | + |
| 175 | + - name: combine manifests |
| 176 | + uses: Noelware/docker-manifest-action@v1 |
| 177 | + with: |
| 178 | + tags: snipe/snipe-it:{{branch}}-combined |
| 179 | + inputs: snipe/snipe-it:{{branch}}-intel,snipe/snipe-it:{{branch}}-arm |
| 180 | + push: true |
| 181 | + |
| 182 | + |
0 commit comments