mirror of
https://github.com/katanemo/plano.git
synced 2026-06-08 14:55:14 +02:00
Publish docker images to DigitalOcean Container Registry (#868)
This commit is contained in:
parent
5d79e7a7d4
commit
1d3f4d6c05
1 changed files with 81 additions and 0 deletions
81
.github/workflows/docker-push-release.yml
vendored
81
.github/workflows/docker-push-release.yml
vendored
|
|
@ -3,10 +3,13 @@ name: Publish docker image (release)
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: katanemo/plano
|
DOCKER_IMAGE: katanemo/plano
|
||||||
GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/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:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
workflow_dispatch: # remove after testing
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -33,6 +36,14 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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
|
- name: Extract metadata for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
|
|
@ -51,6 +62,21 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.meta.outputs.tags }}-arm64
|
${{ steps.meta.outputs.tags }}-arm64
|
||||||
${{ env.GHCR_IMAGE }}:${{ github.event.release.tag_name }}-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 image on GitHub's AMD64 runner — push to both registries
|
||||||
build-amd64:
|
build-amd64:
|
||||||
|
|
@ -72,6 +98,14 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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
|
- name: Extract metadata for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
|
|
@ -90,6 +124,21 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.meta.outputs.tags }}-amd64
|
${{ steps.meta.outputs.tags }}-amd64
|
||||||
${{ env.GHCR_IMAGE }}:${{ github.event.release.tag_name }}-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
|
# Combine ARM64 and AMD64 images into multi-arch manifests for both registries
|
||||||
create-manifest:
|
create-manifest:
|
||||||
|
|
@ -109,6 +158,14 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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
|
- name: Extract metadata for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
|
|
@ -131,3 +188,27 @@ jobs:
|
||||||
-t ${{ env.GHCR_IMAGE }}:${TAG} \
|
-t ${{ env.GHCR_IMAGE }}:${TAG} \
|
||||||
${{ env.GHCR_IMAGE }}:${TAG}-arm64 \
|
${{ env.GHCR_IMAGE }}:${TAG}-arm64 \
|
||||||
${{ env.GHCR_IMAGE }}:${TAG}-amd64
|
${{ 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