@@ -116,7 +116,7 @@ jobs:
116116 Install-Module -Name Pester -Repository PSGallery -Force -Scope CurrentUser -MaximumVersion $PesterMaxVersion -SkipPublisherCheck -AllowClobber
117117 Import-Module Pester -Force -PassThru -MaximumVersion $PesterMaxVersion} @Parameters
118118 - name : Check out repository
119- uses : actions/checkout@v2
119+ uses : actions/checkout@v4
120120 - name : RunPester
121121 id : RunPester
122122 shell : pwsh
@@ -173,9 +173,6 @@ jobs:
173173 $result =
174174 Invoke-Pester -PassThru -Verbose -OutputFile ".\$moduleName.TestResults.xml" -OutputFormat NUnitXml @codeCoverageParameters
175175
176- "::set-output name=TotalCount::$($result.TotalCount)",
177- "::set-output name=PassedCount::$($result.PassedCount)",
178- "::set-output name=FailedCount::$($result.FailedCount)" | Out-Host
179176 if ($result.FailedCount -gt 0) {
180177 "::debug:: $($result.FailedCount) tests failed"
181178 foreach ($r in $result.TestResult) {
@@ -187,7 +184,7 @@ jobs:
187184 }
188185 } @Parameters
189186 - name : PublishTestResults
190- uses : actions/upload-artifact@v2
187+ uses : actions/upload-artifact@v3
191188 with :
192189 name : PesterResults
193190 path : ' **.TestResults.xml'
@@ -593,6 +590,43 @@ jobs:
593590 - name : PSA
594591 uses : StartAutomating/PSA@main
595592 id : PSA
593+ - name : Log in to ghcr.io
594+ uses : docker/login-action@master
595+ with :
596+ registry : ${{ env.REGISTRY }}
597+ username : ${{ github.actor }}
598+ password : ${{ secrets.GITHUB_TOKEN }}
599+ - name : Extract Docker Metadata (for branch)
600+ if : ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
601+ id : meta
602+ uses : docker/metadata-action@master
603+ with :
604+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
605+ - name : Extract Docker Metadata (for main)
606+ if : ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
607+ id : metaMain
608+ uses : docker/metadata-action@master
609+ with :
610+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
611+ flavor : latest=true
612+ - name : Build and push Docker image (from main)
613+ if : ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
614+ uses : docker/build-push-action@master
615+ with :
616+ context : .
617+ push : true
618+ tags : ${{ steps.metaMain.outputs.tags }}
619+ labels : ${{ steps.metaMain.outputs.labels }}
620+ - name : Build and push Docker image (from branch)
621+ if : ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
622+ uses : docker/build-push-action@master
623+ with :
624+ context : .
625+ push : true
626+ tags : ${{ steps.meta.outputs.tags }}
627+ labels : ${{ steps.meta.outputs.labels }}
596628env :
597- AT_PROTOCOL_APP_PASSWORD : ${{ secrets.AT_PROTOCOL_APP_PASSWORD }}
598629 AT_PROTOCOL_HANDLE : mrpowershell.bsky.social
630+ AT_PROTOCOL_APP_PASSWORD : ${{ secrets.AT_PROTOCOL_APP_PASSWORD }}
631+ REGISTRY : ghcr.io
632+ IMAGE_NAME : ${{ github.repository }}
0 commit comments