Tag Self-Hosted Images as latest #10
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: Tag Self-Hosted Images as latest | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| github_sha: | |
| description: | |
| "Rev to tag as latest. Pick from | |
| https://github.com/get-convex/convex-backend/pkgs/container/convex-backend" | |
| type: string | |
| required: true | |
| jobs: | |
| tag_images_as_latest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Modify convex-backend manifest with latest tag | |
| run: | | |
| digests=$(docker manifest inspect ghcr.io/get-convex/convex-backend:${{ inputs.github_sha }} | jq -r '.manifests[].digest') | |
| args=() | |
| for digest in $digests; do | |
| args+=(--amend "ghcr.io/get-convex/convex-backend@$digest") | |
| done | |
| docker manifest create ghcr.io/get-convex/convex-backend:latest "${args[@]}" | |
| docker manifest push ghcr.io/get-convex/convex-backend:latest | |
| - name: Modify dashboard manifest with latest tag | |
| run: | | |
| digests=$(docker manifest inspect ghcr.io/get-convex/convex-dashboard:${{ inputs.github_sha }} | jq -r '.manifests[].digest') | |
| args=() | |
| for digest in $digests; do | |
| args+=(--amend "ghcr.io/get-convex/convex-dashboard@$digest") | |
| done | |
| docker manifest create ghcr.io/get-convex/convex-dashboard:latest "${args[@]}" | |
| docker manifest push ghcr.io/get-convex/convex-dashboard:latest |