Push container images #28
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Push container images | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Full version of container image to push. Normally, this should exactly match the tag name. | |
| required: true | |
| type: string | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| name: Push | |
| defaults: | |
| run: | |
| shell: pwsh | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Validate build version | |
| id: validate | |
| uses: ./.github/actions/validate-version | |
| with: | |
| version: ${{ inputs.version }} | |
| - name: Log in to GitHub container registry | |
| uses: docker/login-action@v3.7.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3.7.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3.12.0 | |
| - name: Publish to Docker Hub | |
| run: | | |
| $tags = "${{ steps.validate.outputs.container-tags }}" -Split ',' | |
| $sourceTag = "${{ inputs.version }}" | |
| $tagsCLI = $tags -replace "^", "--tag particular/servicepulse:" | |
| $cmd = "docker buildx imagetools create $tagsCLI ghcr.io/particular/servicepulse:$sourceTag" | |
| Write-Output "Command: $cmd" | |
| Invoke-Expression $cmd | |
| - name: Update Docker Hub Description | |
| if: ${{ steps.validate.outputs.latest == 'true' }} | |
| uses: peter-evans/dockerhub-description@v5.0.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: particular/servicepulse | |
| readme-filepath: ./Container-README.md | |
| short-description: Keep track of the health and performance of your system's endpoints. |