mirror of
https://github.com/katanemo/plano.git
synced 2026-04-26 01:06:25 +02:00
publish docker images to DigitalOcean Container Registry
This commit is contained in:
parent
76ff353c1e
commit
790405f6dc
2 changed files with 158 additions and 0 deletions
80
.github/workflows/docker-push-release.yml
vendored
80
.github/workflows/docker-push-release.yml
vendored
|
|
@ -3,6 +3,8 @@ name: Publish docker image (release)
|
|||
env:
|
||||
DOCKER_IMAGE: katanemo/plano
|
||||
GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/plano
|
||||
DOCR_IMAGE: registry.digitalocean.com/genai-prod/plano
|
||||
DOCR_PREVIEW_IMAGE: registry.digitalocean.com/genai-preview/plano
|
||||
|
||||
on:
|
||||
release:
|
||||
|
|
@ -33,6 +35,14 @@ jobs:
|
|||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.PLATFORM_DIGITALOCEAN_TOKEN }}
|
||||
|
||||
- name: Log in to DOCR (prod)
|
||||
run: doctl registry login
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
|
|
@ -51,6 +61,21 @@ jobs:
|
|||
tags: |
|
||||
${{ steps.meta.outputs.tags }}-arm64
|
||||
${{ env.GHCR_IMAGE }}:${{ github.event.release.tag_name }}-arm64
|
||||
${{ env.DOCR_IMAGE }}:${{ github.event.release.tag_name }}-arm64
|
||||
|
||||
- name: Switch to DOCR preview
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.PLATFORM_DIGITALOCEAN_TOKEN_PREVIEW }}
|
||||
|
||||
- name: Log in to DOCR (preview)
|
||||
run: doctl registry login
|
||||
|
||||
- name: Push to DOCR Preview
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t ${{ env.DOCR_PREVIEW_IMAGE }}:${{ github.event.release.tag_name }}-arm64 \
|
||||
${{ steps.meta.outputs.tags }}-arm64
|
||||
|
||||
# Build AMD64 image on GitHub's AMD64 runner — push to both registries
|
||||
build-amd64:
|
||||
|
|
@ -72,6 +97,14 @@ jobs:
|
|||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.PLATFORM_DIGITALOCEAN_TOKEN }}
|
||||
|
||||
- name: Log in to DOCR (prod)
|
||||
run: doctl registry login
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
|
|
@ -90,6 +123,21 @@ jobs:
|
|||
tags: |
|
||||
${{ steps.meta.outputs.tags }}-amd64
|
||||
${{ env.GHCR_IMAGE }}:${{ github.event.release.tag_name }}-amd64
|
||||
${{ env.DOCR_IMAGE }}:${{ github.event.release.tag_name }}-amd64
|
||||
|
||||
- name: Switch to DOCR preview
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.PLATFORM_DIGITALOCEAN_TOKEN_PREVIEW }}
|
||||
|
||||
- name: Log in to DOCR (preview)
|
||||
run: doctl registry login
|
||||
|
||||
- name: Push to DOCR Preview
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t ${{ env.DOCR_PREVIEW_IMAGE }}:${{ github.event.release.tag_name }}-amd64 \
|
||||
${{ steps.meta.outputs.tags }}-amd64
|
||||
|
||||
# Combine ARM64 and AMD64 images into multi-arch manifests for both registries
|
||||
create-manifest:
|
||||
|
|
@ -109,6 +157,14 @@ jobs:
|
|||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install doctl
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.PLATFORM_DIGITALOCEAN_TOKEN }}
|
||||
|
||||
- name: Log in to DOCR (prod)
|
||||
run: doctl registry login
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
|
|
@ -131,3 +187,27 @@ jobs:
|
|||
-t ${{ env.GHCR_IMAGE }}:${TAG} \
|
||||
${{ env.GHCR_IMAGE }}:${TAG}-arm64 \
|
||||
${{ env.GHCR_IMAGE }}:${TAG}-amd64
|
||||
|
||||
- name: Create DOCR Prod Multi-Arch Manifest
|
||||
run: |
|
||||
TAG=${{ github.event.release.tag_name }}
|
||||
docker buildx imagetools create \
|
||||
-t ${{ env.DOCR_IMAGE }}:${TAG} \
|
||||
${{ env.DOCR_IMAGE }}:${TAG}-arm64 \
|
||||
${{ env.DOCR_IMAGE }}:${TAG}-amd64
|
||||
|
||||
- name: Switch to DOCR preview
|
||||
uses: digitalocean/action-doctl@v2
|
||||
with:
|
||||
token: ${{ secrets.PLATFORM_DIGITALOCEAN_TOKEN_PREVIEW }}
|
||||
|
||||
- name: Log in to DOCR (preview)
|
||||
run: doctl registry login
|
||||
|
||||
- name: Create DOCR Preview Multi-Arch Manifest
|
||||
run: |
|
||||
TAG=${{ github.event.release.tag_name }}
|
||||
docker buildx imagetools create \
|
||||
-t ${{ env.DOCR_PREVIEW_IMAGE }}:${TAG} \
|
||||
${{ steps.meta.outputs.tags }}-arm64 \
|
||||
${{ steps.meta.outputs.tags }}-amd64
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue