ci(publish.yml): neutralize — native pipeline is .hanzo/workflows/deploy.yml; GitHub is a mirror
This commit is contained in:
@@ -1,182 +1,8 @@
|
||||
name: Publish Docker
|
||||
|
||||
name: Publish Docker (moved to native pipeline)
|
||||
on:
|
||||
push:
|
||||
branches: ['release']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Git tag to build and publish (e.g., v1.0.0)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build_and_publish_platform_containers:
|
||||
name: Build and publish platform containers
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- warp-ubuntu-latest-x64-4x
|
||||
- warp-ubuntu-latest-arm64-4x
|
||||
|
||||
notice:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.tag || github.ref }}
|
||||
fetch-tags: true
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- name: Build the docker image
|
||||
env:
|
||||
BUILD_PLATFORM: ${{ matrix.os == 'warp-ubuntu-latest-arm64-4x' && 'arm64' || 'amd64' }}
|
||||
NEXT_PRIVATE_TELEMETRY_KEY: ${{ secrets.NEXT_PRIVATE_TELEMETRY_KEY }}
|
||||
NEXT_PRIVATE_TELEMETRY_HOST: ${{ secrets.NEXT_PRIVATE_TELEMETRY_HOST }}
|
||||
APP_VERSION: ${{ inputs.tag || '' }}
|
||||
run: |
|
||||
if [ -z "$APP_VERSION" ]; then
|
||||
APP_VERSION="$(git name-rev --tags --name-only $(git rev-parse HEAD) | head -n 1 | sed 's/\^0//')"
|
||||
fi
|
||||
GIT_SHA="$(git rev-parse HEAD)"
|
||||
|
||||
docker build \
|
||||
-f ./docker/Dockerfile \
|
||||
--progress=plain \
|
||||
--build-arg NEXT_PRIVATE_TELEMETRY_KEY="${NEXT_PRIVATE_TELEMETRY_KEY:-}" \
|
||||
--build-arg NEXT_PRIVATE_TELEMETRY_HOST="${NEXT_PRIVATE_TELEMETRY_HOST:-}" \
|
||||
-t "hanzo-sign/hanzo-sign-$BUILD_PLATFORM:latest" \
|
||||
-t "hanzo-sign/hanzo-sign-$BUILD_PLATFORM:$GIT_SHA" \
|
||||
-t "hanzo-sign/hanzo-sign-$BUILD_PLATFORM:$APP_VERSION" \
|
||||
-t "ghcr.io/hanzo-sign/hanzo-sign-$BUILD_PLATFORM:latest" \
|
||||
-t "ghcr.io/hanzo-sign/hanzo-sign-$BUILD_PLATFORM:$GIT_SHA" \
|
||||
-t "ghcr.io/hanzo-sign/hanzo-sign-$BUILD_PLATFORM:$APP_VERSION" \
|
||||
.
|
||||
|
||||
- name: Push the docker image to DockerHub
|
||||
run: docker push --all-tags "hanzo-sign/hanzo-sign-$BUILD_PLATFORM"
|
||||
env:
|
||||
BUILD_PLATFORM: ${{ matrix.os == 'warp-ubuntu-latest-arm64-4x' && 'arm64' || 'amd64' }}
|
||||
|
||||
- name: Push the docker image to GitHub Container Registry
|
||||
run: docker push --all-tags "ghcr.io/hanzo-sign/hanzo-sign-$BUILD_PLATFORM"
|
||||
env:
|
||||
BUILD_PLATFORM: ${{ matrix.os == 'warp-ubuntu-latest-arm64-4x' && 'arm64' || 'amd64' }}
|
||||
|
||||
create_and_publish_manifest:
|
||||
name: Create and publish manifest
|
||||
runs-on: hanzo-build-linux-amd64
|
||||
needs: build_and_publish_platform_containers
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.tag || github.ref }}
|
||||
fetch-tags: true
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- name: Create and push DockerHub manifest
|
||||
env:
|
||||
APP_VERSION: ${{ inputs.tag || '' }}
|
||||
run: |
|
||||
if [ -z "$APP_VERSION" ]; then
|
||||
APP_VERSION="$(git name-rev --tags --name-only $(git rev-parse HEAD) | head -n 1 | sed 's/\^0//')"
|
||||
fi
|
||||
GIT_SHA="$(git rev-parse HEAD)"
|
||||
|
||||
# Check if the version is stable (no rc or beta in the version)
|
||||
if [[ "$APP_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
docker manifest create \
|
||||
hanzo-sign/hanzo-sign:latest \
|
||||
--amend hanzo-sign/hanzo-sign-amd64:latest \
|
||||
--amend hanzo-sign/hanzo-sign-arm64:latest
|
||||
|
||||
docker manifest push hanzo-sign/hanzo-sign:latest
|
||||
fi
|
||||
|
||||
if [[ "$APP_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]]; then
|
||||
docker manifest create \
|
||||
hanzo-sign/hanzo-sign:rc \
|
||||
--amend hanzo-sign/hanzo-sign-amd64:rc \
|
||||
--amend hanzo-sign/hanzo-sign-arm64:rc
|
||||
|
||||
docker manifest push hanzo-sign/hanzo-sign:rc
|
||||
fi
|
||||
|
||||
docker manifest create \
|
||||
hanzo-sign/hanzo-sign:$GIT_SHA \
|
||||
--amend hanzo-sign/hanzo-sign-amd64:$GIT_SHA \
|
||||
--amend hanzo-sign/hanzo-sign-arm64:$GIT_SHA
|
||||
|
||||
docker manifest create \
|
||||
hanzo-sign/hanzo-sign:$APP_VERSION \
|
||||
--amend hanzo-sign/hanzo-sign-amd64:$APP_VERSION \
|
||||
--amend hanzo-sign/hanzo-sign-arm64:$APP_VERSION
|
||||
|
||||
docker manifest push hanzo-sign/hanzo-sign:$GIT_SHA
|
||||
docker manifest push hanzo-sign/hanzo-sign:$APP_VERSION
|
||||
|
||||
- name: Create and push Github Container Registry manifest
|
||||
env:
|
||||
APP_VERSION: ${{ inputs.tag || '' }}
|
||||
run: |
|
||||
if [ -z "$APP_VERSION" ]; then
|
||||
APP_VERSION="$(git name-rev --tags --name-only $(git rev-parse HEAD) | head -n 1 | sed 's/\^0//')"
|
||||
fi
|
||||
GIT_SHA="$(git rev-parse HEAD)"
|
||||
|
||||
# Check if the version is stable (no rc or beta in the version)
|
||||
if [[ "$APP_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
docker manifest create \
|
||||
ghcr.io/hanzo-sign/hanzo-sign:latest \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-amd64:latest \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-arm64:latest
|
||||
|
||||
docker manifest push ghcr.io/hanzo-sign/hanzo-sign:latest
|
||||
fi
|
||||
|
||||
if [[ "$APP_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]]; then
|
||||
docker manifest create \
|
||||
ghcr.io/hanzo-sign/hanzo-sign:rc \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-amd64:rc \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-arm64:rc
|
||||
|
||||
docker manifest push ghcr.io/hanzo-sign/hanzo-sign:rc
|
||||
fi
|
||||
|
||||
docker manifest create \
|
||||
ghcr.io/hanzo-sign/hanzo-sign:$GIT_SHA \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-amd64:$GIT_SHA \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-arm64:$GIT_SHA
|
||||
|
||||
docker manifest create \
|
||||
ghcr.io/hanzo-sign/hanzo-sign:$APP_VERSION \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-amd64:$APP_VERSION \
|
||||
--amend ghcr.io/hanzo-sign/hanzo-sign-arm64:$APP_VERSION
|
||||
|
||||
docker manifest push ghcr.io/hanzo-sign/hanzo-sign:$GIT_SHA
|
||||
docker manifest push ghcr.io/hanzo-sign/hanzo-sign:$APP_VERSION
|
||||
- run: echo "native pipeline is .hanzo/workflows/deploy.yml; GitHub is a mirror"
|
||||
|
||||
Reference in New Issue
Block a user