Skip to content

Commit dc2e285

Browse files
committed
only push if tests pass
1 parent b376ac0 commit dc2e285

File tree

4 files changed

+102
-63
lines changed

4 files changed

+102
-63
lines changed

Diff for: .github/workflows/release_local_backend.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,31 @@ jobs:
7979
outputs:
8080
result: "${{ steps.read.outputs.result }}"
8181

82-
push:
83-
name: Push merged image manifest
84-
needs: [read]
85-
runs-on: ubuntu-latest
86-
steps:
87-
- name: Login to GitHub Container Registry
88-
uses: docker/login-action@v2
89-
with:
90-
registry: ghcr.io
91-
username: ${{ github.actor }}
92-
password: ${{ secrets.GITHUB_TOKEN }}
82+
# push:
83+
# name: Push merged image manifest
84+
# needs: [read]
85+
# runs-on: ubuntu-latest
86+
# steps:
87+
# - name: Login to GitHub Container Registry
88+
# uses: docker/login-action@v2
89+
# with:
90+
# registry: ghcr.io
91+
# username: ${{ github.actor }}
92+
# password: ${{ secrets.GITHUB_TOKEN }}
9393

94-
- name: Set up Docker Buildx
95-
uses: docker/setup-buildx-action@v3
94+
# - name: Set up Docker Buildx
95+
# uses: docker/setup-buildx-action@v3
9696

97-
- name: Push manifest
98-
run: |
99-
docker manifest create ghcr.io/get-convex/convex-backend:${{ github.sha }} \
100-
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-x64'] }} \
101-
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-arm64'] }}
102-
docker manifest push ghcr.io/get-convex/convex-backend:${{ github.sha }}
97+
# - name: Push manifest
98+
# run: |
99+
# docker manifest create ghcr.io/get-convex/convex-backend:${{ github.sha }} \
100+
# --amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-x64'] }} \
101+
# --amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-arm64'] }}
102+
# docker manifest push ghcr.io/get-convex/convex-backend:${{ github.sha }}
103103

104-
if [[ "${{ inputs.tag_latest }}" == "true" ]]; then
105-
docker manifest create ghcr.io/get-convex/convex-backend:latest \
106-
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-x64'] }} \
107-
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-arm64'] }}
108-
docker manifest push ghcr.io/get-convex/convex-backend:latest
109-
fi
104+
# if [[ "${{ inputs.tag_latest }}" == "true" ]]; then
105+
# docker manifest create ghcr.io/get-convex/convex-backend:latest \
106+
# --amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-x64'] }} \
107+
# --amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.read.outputs.result).digest['backend-arm64'] }}
108+
# docker manifest push ghcr.io/get-convex/convex-backend:latest
109+
# fi

Diff for: .github/workflows/release_local_dashboard.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -73,31 +73,31 @@ jobs:
7373
outputs:
7474
result: "${{ steps.read.outputs.result }}"
7575

76-
push:
77-
name: Push merged image manifest
78-
needs: [read]
79-
runs-on: ubuntu-latest
80-
steps:
81-
- name: Login to GitHub Container Registry
82-
uses: docker/login-action@v2
83-
with:
84-
registry: ghcr.io
85-
username: ${{ github.actor }}
86-
password: ${{ secrets.GITHUB_TOKEN }}
76+
# push:
77+
# name: Push merged image manifest
78+
# needs: [read]
79+
# runs-on: ubuntu-latest
80+
# steps:
81+
# - name: Login to GitHub Container Registry
82+
# uses: docker/login-action@v2
83+
# with:
84+
# registry: ghcr.io
85+
# username: ${{ github.actor }}
86+
# password: ${{ secrets.GITHUB_TOKEN }}
8787

88-
- name: Set up Docker Buildx
89-
uses: docker/setup-buildx-action@v3
88+
# - name: Set up Docker Buildx
89+
# uses: docker/setup-buildx-action@v3
9090

91-
- name: Push manifest
92-
run: |
93-
docker manifest create ghcr.io/get-convex/convex-dashboard:${{ github.sha }} \
94-
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-x64'] }} \
95-
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-arm64'] }}
96-
docker manifest push ghcr.io/get-convex/convex-dashboard:${{ github.sha }}
91+
# - name: Push manifest
92+
# run: |
93+
# docker manifest create ghcr.io/get-convex/convex-dashboard:${{ github.sha }} \
94+
# --amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-x64'] }} \
95+
# --amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-arm64'] }}
96+
# docker manifest push ghcr.io/get-convex/convex-dashboard:${{ github.sha }}
9797

98-
if [[ "${{ inputs.tag_latest }}" == "true" ]]; then
99-
docker manifest create ghcr.io/get-convex/convex-dashboard:latest \
100-
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-x64'] }} \
101-
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-arm64'] }}
102-
docker manifest push ghcr.io/get-convex/convex-dashboard:latest
103-
fi
98+
# if [[ "${{ inputs.tag_latest }}" == "true" ]]; then
99+
# docker manifest create ghcr.io/get-convex/convex-dashboard:latest \
100+
# --amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-x64'] }} \
101+
# --amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.read.outputs.result).digest['dashboard-arm64'] }}
102+
# docker manifest push ghcr.io/get-convex/convex-dashboard:latest
103+
# fi

Diff for: .github/workflows/release_self_hosted_images.yml

+46-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: ./.github/workflows/release_local_backend.yml
2020
with:
2121
# Do not tag docker images triggered by migrations as latest.
22-
tag_latest: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest || false }}
22+
tag_latest: false
2323
permissions:
2424
contents: read
2525
packages: write
@@ -28,8 +28,8 @@ jobs:
2828
release_dashboard:
2929
uses: ./.github/workflows/release_local_dashboard.yml
3030
with:
31-
# Do not tag docker images triggered by migrations as latest.
32-
tag_latest: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest || false }}
31+
# Do not tag docker images yet
32+
tag_latest: false
3333
permissions:
3434
contents: read
3535
packages: write
@@ -39,4 +39,46 @@ jobs:
3939
needs: release_backend
4040
uses: ./.github/workflows/test_self_hosted_backend.yml
4141
with:
42-
git_sha: ${{ github.sha }}
42+
image_digest_x64: ${{ fromJson(needs.release_backend.outputs.result).digest['backend-x64'] }}
43+
image_digest_arm64: ${{ fromJson(needs.release_backend.outputs.result).digest['backend-arm64'] }}
44+
45+
tag_images:
46+
needs: [release_backend, release_dashboard, test_backend]
47+
# Only run this job if the tests passed
48+
if: success()
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Login to GitHub Container Registry
52+
uses: docker/login-action@v2
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Tag and push backend manifest
59+
run: |
60+
docker manifest create ghcr.io/get-convex/convex-backend:${{ github.sha }} \
61+
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.release_backend.outputs.result).digest['backend-x64'] }} \
62+
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.release_backend.outputs.result).digest['backend-arm64'] }}
63+
docker manifest push ghcr.io/get-convex/convex-backend:${{ github.sha }}
64+
65+
if [[ "${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest || false }}" == "true" ]]; then
66+
docker manifest create ghcr.io/get-convex/convex-backend:latest \
67+
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.release_backend.outputs.result).digest['backend-x64'] }} \
68+
--amend ghcr.io/get-convex/convex-backend@${{ fromJson(needs.release_backend.outputs.result).digest['backend-arm64'] }}
69+
docker manifest push ghcr.io/get-convex/convex-backend:latest
70+
fi
71+
72+
- name: Tag and push dashboard manifest
73+
run: |
74+
docker manifest create ghcr.io/get-convex/convex-dashboard:${{ github.sha }} \
75+
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.release_dashboard.outputs.result).digest['dashboard-x64'] }} \
76+
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.release_dashboard.outputs.result).digest['dashboard-arm64'] }}
77+
docker manifest push ghcr.io/get-convex/convex-dashboard:${{ github.sha }}
78+
79+
if [[ "${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest || false }}" == "true" ]]; then
80+
docker manifest create ghcr.io/get-convex/convex-dashboard:latest \
81+
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.release_dashboard.outputs.result).digest['dashboard-x64'] }} \
82+
--amend ghcr.io/get-convex/convex-dashboard@${{ fromJson(needs.release_dashboard.outputs.result).digest['dashboard-arm64'] }}
83+
docker manifest push ghcr.io/get-convex/convex-dashboard:latest
84+
fi

Diff for: .github/workflows/test_self_hosted_backend.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ name: Test Self-Hosted Backend
33
on:
44
workflow_call:
55
inputs:
6-
git_sha:
7-
description: "Git SHA for backend image tag to test"
6+
image_digest_x64:
7+
description: "x64 image digest to test"
88
type: string
99
required: true
10-
workflow_dispatch:
11-
inputs:
12-
git_sha:
13-
description: "Git SHA for backend image tag to test (defaults to latest)"
10+
image_digest_arm64:
11+
description: "arm64 image digest to test"
1412
type: string
15-
required: false
16-
default: "latest"
13+
required: true
1714

1815
jobs:
1916
test_docker_compose:
@@ -23,7 +20,7 @@ jobs:
2320

2421
services:
2522
backend:
26-
image: ghcr.io/get-convex/convex-backend:${{ inputs.git_sha }}
23+
image: ghcr.io/get-convex/convex-backend@${{ inputs.image_digest_x64 }}
2724
env:
2825
ACTIONS_USER_TIMEOUT_SECS: "20"
2926
CONVEX_CLOUD_ORIGIN: "http://127.0.0.1:3210"

0 commit comments

Comments
 (0)