Skip to content

Release Self-Hosted Images #35

Release Self-Hosted Images

Release Self-Hosted Images #35

name: Release Self-Hosted Images
on:
workflow_dispatch:
inputs:
tag_latest:
description: "Tag images as latest"
type: boolean
default: false
required: true
push:
branches:
- main
paths:
- "crates/model/src/migrations.rs"
jobs:
release_backend:
uses: ./.github/workflows/release_local_backend.yml
with:
# Do not tag docker images triggered by migrations as latest.
tag_latest: false
permissions:
contents: read
packages: write
id-token: write
release_dashboard:
uses: ./.github/workflows/release_local_dashboard.yml
with:
# Do not tag docker images yet
tag_latest: false
permissions:
contents: read
packages: write
id-token: write
test_backend:
needs: release_backend
uses: ./.github/workflows/test_self_hosted_backend.yml
with:
image_digest_x64: ${{ needs.release_backend.outputs.backend_x64_digest }}
image_digest_arm64: ${{ needs.release_backend.outputs.backend_arm64_digest }}
tag_images:
needs: [release_backend, release_dashboard, test_backend]
# Only run this job if the tests passed
if: success()
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: Tag and push backend manifest
run: |
docker manifest create ghcr.io/get-convex/convex-backend:${{ github.sha }} \
--amend ghcr.io/get-convex/convex-backend@${{ needs.release_backend.outputs.backend_x64_digest }} \
--amend ghcr.io/get-convex/convex-backend@${{ needs.release_backend.outputs.backend_arm64_digest }}
docker manifest push ghcr.io/get-convex/convex-backend:${{ github.sha }}
if [[ "${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest || false }}" == "true" ]]; then
docker manifest create ghcr.io/get-convex/convex-backend:latest \
--amend ghcr.io/get-convex/convex-backend@${{ needs.release_backend.outputs.backend_x64_digest }} \
--amend ghcr.io/get-convex/convex-backend@${{ needs.release_backend.outputs.backend_arm64_digest }}
docker manifest push ghcr.io/get-convex/convex-backend:latest
fi
- name: Tag and push dashboard manifest
run: |
docker manifest create ghcr.io/get-convex/convex-dashboard:${{ github.sha }} \
--amend ghcr.io/get-convex/convex-dashboard@${{ needs.release_dashboard.outputs.dashboard_x64_digest }} \
--amend ghcr.io/get-convex/convex-dashboard@${{ needs.release_dashboard.outputs.dashboard_arm64_digest }}
docker manifest push ghcr.io/get-convex/convex-dashboard:${{ github.sha }}
if [[ "${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest || false }}" == "true" ]]; then
docker manifest create ghcr.io/get-convex/convex-dashboard:latest \
--amend ghcr.io/get-convex/convex-dashboard@${{ needs.release_dashboard.outputs.dashboard_x64_digest }} \
--amend ghcr.io/get-convex/convex-dashboard@${{ needs.release_dashboard.outputs.dashboard_arm64_digest }}
docker manifest push ghcr.io/get-convex/convex-dashboard:latest
fi