1111 branches:
1212 - master
1313jobs:
14+ test-nogitdiff:
15+ runs-on: ubuntu-latest
16+ container:
17+ image: mcr.microsoft.com/powershell:7.2.2-alpine-3.14-20220318
18+ steps:
19+ - run: |
20+ apk add --no-cache git
21+ - uses: actions/checkout@v3
22+ - name: Ignore git permissions
23+ run: |
24+ git config --global --add safe.directory "$( pwd )"
25+ - name: Generate variants
26+ run: |
27+ pwsh -Command '
28+ $ErrorActionPreference = "Stop"
29+ Install-Module -Name Generate-DockerImageVariants -Force -Scope CurrentUser -Verbose
30+ Generate-DockerImageVariants .
31+ '
32+ - name: Test - no git diff
33+ run: |
34+ git diff --exit-code
1435'@
1536
1637$local :WORKFLOW_JOB_NAMES = $VARIANTS | % { " build-$ ( $_ [' tag' ].Replace(' .' , ' -' ) ) " }
@@ -177,9 +198,6 @@ if ( $_['tag_as_latest'] ) {
177198
178199 update-draft-release:
179200 needs: [$ ( $local :WORKFLOW_JOB_NAMES -join ' , ' ) ]
180- "@
181- @'
182-
183201 if: github.ref == 'refs/heads/master'
184202 runs-on: ubuntu-latest
185203 steps:
@@ -189,17 +207,10 @@ if ( $_['tag_as_latest'] ) {
189207 config-name: release-drafter.yml
190208 publish: false
191209 env:
192- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
193- '@
194-
195- @"
196-
210+ GITHUB_TOKEN: `$ {{ secrets.GITHUB_TOKEN }}
197211
198212 publish-draft-release:
199213 needs: [$ ( $local :WORKFLOW_JOB_NAMES -join ' , ' ) ]
200- "@
201- @'
202-
203214 if: startsWith(github.ref, 'refs/tags/')
204215 runs-on: ubuntu-latest
205216 steps:
@@ -208,9 +219,23 @@ if ( $_['tag_as_latest'] ) {
208219 with:
209220 config-name: release-drafter.yml
210221 publish: true
211- name: ${{ github.ref_name }} # E.g. 'master' or 'v1.2.3'
212- tag: ${{ github.ref_name }} # E.g. 'master' or 'v1.2.3'
222+ name: ` $ {{ github.ref_name }} # E.g. 'master' or 'v1.2.3'
223+ tag: ` $ {{ github.ref_name }} # E.g. 'master' or 'v1.2.3'
213224 env:
214- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225+ GITHUB_TOKEN: ` $ {{ secrets.GITHUB_TOKEN }}
215226
216- '@
227+ update-dockerhub-description:
228+ needs: [$ ( $local :WORKFLOW_JOB_NAMES -join ' , ' ) ]
229+ if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
230+ runs-on: ubuntu-latest
231+ steps:
232+ - uses: actions/checkout@v3
233+ - name: Docker Hub Description
234+ uses: peter-evans/dockerhub-description@v3
235+ with:
236+ username: `$ {{ secrets.DOCKERHUB_REGISTRY_USER }}
237+ password: `$ {{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
238+ repository: `$ {{ github.repository }}
239+ short-description: `$ {{ github.event.repository.description }}
240+
241+ "@
0 commit comments