|
7 | 7 | required: true |
8 | 8 | type: string |
9 | 9 | tag: |
10 | | - required: true |
| 10 | + required: false |
11 | 11 | type: string |
12 | 12 | tag_latest: |
13 | 13 | required: false |
@@ -88,30 +88,26 @@ jobs: |
88 | 88 | username: ${{ inputs.registry_username }} |
89 | 89 | password: ${{ secrets.registry_password }} |
90 | 90 |
|
91 | | - - if: matrix.tag_main == 'true' |
92 | | - name: Docker meta |
| 91 | + - name: Docker meta |
93 | 92 | id: metadata |
94 | 93 | uses: docker/metadata-action@v3 |
95 | 94 | with: |
96 | 95 | images: | |
97 | 96 | ${{ inputs.image }} |
98 | 97 | tags: | |
99 | | - type=raw,value=latest,enable=${{ inputs.tag_latest }} |
100 | | - type=raw,value=${{ inputs.tag }} |
101 | | - type=raw,value=${{ inputs.tag }}-${{ matrix.tag }} |
102 | | - type=raw,value=${{ inputs.release_version }},enable=${{ inputs.release_version != '' }} |
103 | | - type=raw,value=${{ inputs.release_version }}-${{ matrix.tag }},enable=${{ inputs.release_version != '' }} |
| 98 | + # will set tag 'latest' for ubuntu build on production push |
| 99 | + type=raw,value=latest,enable=${{ matrix.tag_main && inputs.tag_latest }} |
104 | 100 |
|
105 | | - - if: matrix.tag_main == 'false' |
106 | | - name: Docker meta |
107 | | - id: metadata2 |
108 | | - uses: docker/metadata-action@v3 |
109 | | - with: |
110 | | - images: | |
111 | | - ${{ inputs.image }} |
112 | | - tags: | |
| 101 | + # will set tag like 'alpha' for ubuntu build, if inputs.tag is not empty |
| 102 | + type=raw,value=${{ inputs.tag }},enable=${{ matrix.tag_main }} |
| 103 | +
|
| 104 | + # will set tag like 'alpha-(ubuntu|alpine)', if inputs.tag is not empty |
113 | 105 | type=raw,value=${{ inputs.tag }}-${{ matrix.tag }} |
| 106 | +
|
| 107 | + # will set tag like 'v0.12.0' for ubuntu build, if inputs.release_version is not empty |
114 | 108 | type=raw,value=${{ inputs.release_version }},enable=${{ inputs.release_version != '' }} |
| 109 | +
|
| 110 | + # will set tag like 'v0.12.0-(ubuntu|alpine)', if inputs.release_version is not empty |
115 | 111 | type=raw,value=${{ inputs.release_version }}-${{ matrix.tag }},enable=${{ inputs.release_version != '' }} |
116 | 112 |
|
117 | 113 | - name: Build release image |
|
0 commit comments