Push container images #53
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/[email protected] | |
| - name: Validate build version | |
| id: validate | |
| uses: ./.github/actions/validate-version | |
| with: | |
| version: ${{ inputs.version }} | |
| - name: Log in to GitHub container registry | |
| uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to Docker Hub | |
| uses: docker/[email protected] | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/[email protected] | |
| - name: Publish to Docker Hub | |
| run: | | |
| $containers = @('servicecontrol', 'servicecontrol-audit', 'servicecontrol-monitoring', 'servicecontrol-ravendb') | |
| $tags = "${{ steps.validate.outputs.container-tags }}" -Split ',' | |
| $sourceTag = "${{ inputs.version }}" | |
| foreach($name in $containers) | |
| { | |
| Write-Output "::group::Pushing $name with $tags tags" | |
| $tagsCLI = $tags -replace "^", "--tag particular/${name}:" | |
| $cmd = "docker buildx imagetools create $tagsCLI ghcr.io/particular/${name}:$sourceTag" | |
| Write-Output "Command: $cmd" | |
| Invoke-Expression $cmd | |
| Write-Output "::endgroup::" | |
| } | |
| - name: Update Docker Hub Description - ServiceControl | |
| if: ${{ steps.validate.outputs.latest == 'true' }} | |
| uses: peter-evans/[email protected] | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: particular/servicecontrol | |
| readme-filepath: ./src/ServiceControl/Container-README.md | |
| short-description: Gather status, performance and monitoring data for multiple endpoints from a single location. | |
| - name: Update Docker Hub Description - Audit | |
| if: ${{ steps.validate.outputs.latest == 'true' }} | |
| uses: peter-evans/[email protected] | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: particular/servicecontrol-audit | |
| readme-filepath: ./src/ServiceControl.Audit/Container-README.md | |
| short-description: Provide valuable information about the message flow through a system. | |
| - name: Update Docker Hub Description - Monitoring | |
| if: ${{ steps.validate.outputs.latest == 'true' }} | |
| uses: peter-evans/[email protected] | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: particular/servicecontrol-monitoring | |
| readme-filepath: ./src/ServiceControl.Monitoring/Container-README.md | |
| short-description: Track the health of a distributed system. | |
| - name: Update Docker Hub Description - RavenDB | |
| if: ${{ steps.validate.outputs.latest == 'true' }} | |
| uses: peter-evans/[email protected] | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: particular/servicecontrol-ravendb | |
| readme-filepath: ./src/ServiceControl.RavenDB/Container-README.md | |
| short-description: The default storage for ServiceControl instances. |