-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Avoid extra steps and extra images on custom build (#1196)
- Loading branch information
1 parent
ad9d895
commit 3509652
Showing
2 changed files
with
5 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,9 @@ on: | |
branch: | ||
description: "Branch to run the workflow" | ||
required: true | ||
default: "main" | ||
docker_tag: | ||
description: "Tag to be used by the docker image on push" | ||
required: true | ||
default: "latest" | ||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
|
@@ -41,7 +39,6 @@ jobs: | |
images: | | ||
supabase/realtime | ||
tags: | | ||
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} | ||
type=raw,value=${{ github.event.inputs.docker_tag }}_${{ env.arch }} | ||
- uses: docker/setup-buildx-action@v2 | ||
|
@@ -78,7 +75,6 @@ jobs: | |
images: | | ||
supabase/realtime | ||
tags: | | ||
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} | ||
type=raw,value=${{ github.event.inputs.docker_tag }}_${{ env.arch }} | ||
- uses: docker/login-action@v2 | ||
|
@@ -117,13 +113,7 @@ jobs: | |
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Merge multi-arch manifests for versioned output | ||
run: | | ||
docker buildx imagetools create -t supabase/realtime:v${{ needs.release.outputs.version }} \ | ||
supabase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \ | ||
supabase/realtime@${{ needs.docker_arm_release.outputs.image_digest }} | ||
- name: Merge multi-arch manifests for latest output | ||
- name: Merge multi-arch manifests for custom output | ||
run: | | ||
docker buildx imagetools create -t supabase/realtime:${{ github.event.inputs.docker_tag }} \ | ||
supabase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \ | ||
|
@@ -150,21 +140,7 @@ jobs: | |
- name: Mirror to ECR | ||
uses: akhilerm/[email protected] | ||
with: | ||
src: docker.io/supabase/realtime:v${{ needs.release.outputs.version }} | ||
src: docker.io/supabase/realtime:v${{ github.event.inputs.docker_tag }} | ||
dst: | | ||
public.ecr.aws/supabase/realtime:v${{ needs.release.outputs.version }} | ||
ghcr.io/supabase/realtime:v${{ needs.release.outputs.version }} | ||
update-branch-name: | ||
needs: [release, docker_x86_release, docker_arm_release, merge_manifest] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: refs/heads/main | ||
|
||
- name: Update branch name | ||
run: | | ||
git branch -m main releases/v${{ needs.release.outputs.version }} | ||
git push origin HEAD:releases/v${{ needs.release.outputs.version }} | ||
public.ecr.aws/supabase/realtime:v${{ github.event.inputs.docker_tag }} | ||
ghcr.io/supabase/realtime:v${{ github.event.inputs.docker_tag }} |
This file contains 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