|
9 | 9 | REGISTRY: docker.io |
10 | 10 | IMAGE_NAME: ${{ github.repository }} |
11 | 11 | platforms: linux/amd64,linux/arm64 |
| 12 | + DEFAULT_TYPE: "external" |
12 | 13 |
|
13 | 14 | jobs: |
14 | 15 | build-and-push-image: |
@@ -48,34 +49,19 @@ jobs: |
48 | 49 | with: |
49 | 50 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
50 | 51 | tags: | |
| 52 | + type=semver,pattern={{version}},enable=${{ matrix.type == env.DEFAULT_COMBINATION }} |
| 53 | + type=semver,pattern={{version}}-${{ matrix.type }},priority=500 |
| 54 | + type=raw,value=latest,enable=${{ matrix.type == env.DEFAULT_COMBINATION }} |
51 | 55 | type=sha |
52 | 56 |
|
53 | | - - name: Extract metadata (tags, labels) for Docker |
54 | | - id: tagging |
55 | | - uses: HackerHappyHour/tagging-strategy@v3 |
56 | | - with: |
57 | | - image_name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
58 | | - tag_name: ${{ github.event.release.tag_name }} |
59 | | - tags: | |
60 | | - %X%-${{ matrix.type}} |
61 | | - %X.Y%-${{ matrix.type}} |
62 | | - %X.Y.Z%-${{ matrix.type}} |
63 | | - extra_tags: | |
64 | | - latest::${{ matrix.type == 'external'}} |
65 | | - %X%::${{ matrix.type == 'external'}} |
66 | | - %X.Y%::${{ matrix.type == 'external'}} |
67 | | - %X.Y.Z%::${{ matrix.type == 'external'}} |
68 | | -
|
69 | 57 | - name: Build and push Docker image |
70 | 58 | uses: docker/build-push-action@v6 |
71 | 59 | with: |
72 | 60 | context: . |
73 | 61 | file: Dockerfile.${{ matrix.type }} |
74 | 62 | platforms: ${{ env.platforms }} |
75 | 63 | push: true |
76 | | - tags: | |
77 | | - ${{ steps.tagging.outputs.tags }} |
78 | | - ${{ steps.meta.outputs.tags }} |
| 64 | + tags: ${{ steps.meta.outputs.tags }} |
79 | 65 | labels: ${{ steps.meta.outputs.labels }} |
80 | 66 |
|
81 | 67 | - name: Version output |
|
0 commit comments