ci: move manual container builds to unified release workflow (#8290)
* ci: move manual dev container build into unified release workflow * ci: make unified manual container build release-tag based
This commit is contained in:
1
.github/workflows/container_dev.yml
vendored
1
.github/workflows/container_dev.yml
vendored
@@ -3,7 +3,6 @@ name: "docker: build dev containers"
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
152
.github/workflows/container_release1.yml
vendored
152
.github/workflows/container_release1.yml
vendored
@@ -1,152 +0,0 @@
|
|||||||
name: "docker: build release containers for normal volume"
|
|
||||||
|
|
||||||
# DISABLED: Merged into container_release_unified.yml
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
force_run:
|
|
||||||
description: 'This workflow is disabled. Use container_release_unified.yml instead'
|
|
||||||
required: true
|
|
||||||
default: 'disabled'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
platform: [amd64, arm64, arm, 386]
|
|
||||||
include:
|
|
||||||
- platform: amd64
|
|
||||||
qemu: false
|
|
||||||
- platform: arm64
|
|
||||||
qemu: true
|
|
||||||
- platform: arm
|
|
||||||
qemu: true
|
|
||||||
- platform: 386
|
|
||||||
qemu: true
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Free Disk Space
|
|
||||||
run: |
|
|
||||||
echo "Available disk space before cleanup:"
|
|
||||||
df -h
|
|
||||||
# Remove pre-installed tools
|
|
||||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
||||||
# Clean package managers
|
|
||||||
sudo apt-get clean
|
|
||||||
sudo rm -rf /var/lib/apt/lists/*
|
|
||||||
# Clean Docker aggressively
|
|
||||||
sudo docker system prune -af --volumes
|
|
||||||
# Clean Go cache if it exists
|
|
||||||
[ -d ~/.cache/go-build ] && rm -rf ~/.cache/go-build || true
|
|
||||||
[ -d /go/pkg ] && rm -rf /go/pkg || true
|
|
||||||
echo "Available disk space after cleanup:"
|
|
||||||
df -h
|
|
||||||
- name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: chrislusf/seaweedfs
|
|
||||||
tags: type=ref,event=tag
|
|
||||||
flavor: latest=false
|
|
||||||
- name: Set up QEMU
|
|
||||||
if: matrix.qemu
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Create BuildKit config
|
|
||||||
run: |
|
|
||||||
cat > /tmp/buildkitd.toml <<EOF
|
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["https://mirror.gcr.io"]
|
|
||||||
EOF
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
buildkitd-config: /tmp/buildkitd.toml
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Build ${{ matrix.platform }}
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
env:
|
|
||||||
DOCKER_BUILDKIT: 1
|
|
||||||
with:
|
|
||||||
context: ./docker
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
file: ./docker/Dockerfile.go_build
|
|
||||||
platforms: linux/${{ matrix.platform }}
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}-${{ matrix.platform }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
build-args: |
|
|
||||||
BUILDKIT_INLINE_CACHE=1
|
|
||||||
BRANCH=${{ github.sha }}
|
|
||||||
- name: Clean up build artifacts
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
# Clean up Docker build cache and temporary files
|
|
||||||
sudo docker system prune -f
|
|
||||||
# Remove Go build cache
|
|
||||||
sudo rm -rf /tmp/go-build*
|
|
||||||
|
|
||||||
create-manifest:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [build]
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: chrislusf/seaweedfs
|
|
||||||
tags: type=ref,event=tag
|
|
||||||
flavor: latest=false
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Create and push manifest
|
|
||||||
run: |
|
|
||||||
# Function to retry command with exponential backoff
|
|
||||||
retry_with_backoff() {
|
|
||||||
local max_attempts=5
|
|
||||||
local timeout=1
|
|
||||||
local attempt=1
|
|
||||||
local exit_code=0
|
|
||||||
|
|
||||||
while [ $attempt -le $max_attempts ]; do
|
|
||||||
if "$@"; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
exit_code=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $attempt -lt $max_attempts ]; then
|
|
||||||
echo "Attempt $attempt failed. Retrying in ${timeout}s..." >&2
|
|
||||||
sleep $timeout
|
|
||||||
timeout=$((timeout * 2))
|
|
||||||
fi
|
|
||||||
|
|
||||||
attempt=$((attempt + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Command failed after $max_attempts attempts" >&2
|
|
||||||
return $exit_code
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create manifest with retry
|
|
||||||
retry_with_backoff docker buildx imagetools create -t ${{ steps.docker_meta.outputs.tags }} \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-amd64 \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-arm64 \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-arm \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-386
|
|
||||||
153
.github/workflows/container_release2.yml
vendored
153
.github/workflows/container_release2.yml
vendored
@@ -1,153 +0,0 @@
|
|||||||
name: "docker: build release containers for large volume"
|
|
||||||
|
|
||||||
# DISABLED: Merged into container_release_unified.yml
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
force_run:
|
|
||||||
description: 'This workflow is disabled. Use container_release_unified.yml instead'
|
|
||||||
required: true
|
|
||||||
default: 'disabled'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
platform: [amd64, arm64, arm, 386]
|
|
||||||
include:
|
|
||||||
- platform: amd64
|
|
||||||
qemu: false
|
|
||||||
- platform: arm64
|
|
||||||
qemu: true
|
|
||||||
- platform: arm
|
|
||||||
qemu: true
|
|
||||||
- platform: 386
|
|
||||||
qemu: true
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Free Disk Space
|
|
||||||
run: |
|
|
||||||
echo "Available disk space before cleanup:"
|
|
||||||
df -h
|
|
||||||
# Remove pre-installed tools
|
|
||||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
||||||
# Clean package managers
|
|
||||||
sudo apt-get clean
|
|
||||||
sudo rm -rf /var/lib/apt/lists/*
|
|
||||||
# Clean Docker aggressively
|
|
||||||
sudo docker system prune -af --volumes
|
|
||||||
# Clean Go cache if it exists
|
|
||||||
[ -d ~/.cache/go-build ] && rm -rf ~/.cache/go-build || true
|
|
||||||
[ -d /go/pkg ] && rm -rf /go/pkg || true
|
|
||||||
echo "Available disk space after cleanup:"
|
|
||||||
df -h
|
|
||||||
- name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: chrislusf/seaweedfs
|
|
||||||
tags: type=ref,event=tag,suffix=_large_disk
|
|
||||||
flavor: latest=false
|
|
||||||
- name: Set up QEMU
|
|
||||||
if: matrix.qemu
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Create BuildKit config
|
|
||||||
run: |
|
|
||||||
cat > /tmp/buildkitd.toml <<EOF
|
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["https://mirror.gcr.io"]
|
|
||||||
EOF
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
buildkitd-config: /tmp/buildkitd.toml
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Build ${{ matrix.platform }}
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
env:
|
|
||||||
DOCKER_BUILDKIT: 1
|
|
||||||
with:
|
|
||||||
context: ./docker
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
file: ./docker/Dockerfile.go_build
|
|
||||||
build-args: |
|
|
||||||
TAGS=5BytesOffset
|
|
||||||
BUILDKIT_INLINE_CACHE=1
|
|
||||||
BRANCH=${{ github.sha }}
|
|
||||||
platforms: linux/${{ matrix.platform }}
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}-${{ matrix.platform }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
- name: Clean up build artifacts
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
# Clean up Docker build cache and temporary files
|
|
||||||
sudo docker system prune -f
|
|
||||||
# Remove Go build cache
|
|
||||||
sudo rm -rf /tmp/go-build*
|
|
||||||
|
|
||||||
create-manifest:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [build]
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: chrislusf/seaweedfs
|
|
||||||
tags: type=ref,event=tag,suffix=_large_disk
|
|
||||||
flavor: latest=false
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Create and push manifest
|
|
||||||
run: |
|
|
||||||
# Function to retry command with exponential backoff
|
|
||||||
retry_with_backoff() {
|
|
||||||
local max_attempts=5
|
|
||||||
local timeout=1
|
|
||||||
local attempt=1
|
|
||||||
local exit_code=0
|
|
||||||
|
|
||||||
while [ $attempt -le $max_attempts ]; do
|
|
||||||
if "$@"; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
exit_code=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $attempt -lt $max_attempts ]; then
|
|
||||||
echo "Attempt $attempt failed. Retrying in ${timeout}s..." >&2
|
|
||||||
sleep $timeout
|
|
||||||
timeout=$((timeout * 2))
|
|
||||||
fi
|
|
||||||
|
|
||||||
attempt=$((attempt + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Command failed after $max_attempts attempts" >&2
|
|
||||||
return $exit_code
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create manifest with retry
|
|
||||||
retry_with_backoff docker buildx imagetools create -t ${{ steps.docker_meta.outputs.tags }} \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-amd64 \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-arm64 \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-arm \
|
|
||||||
${{ steps.docker_meta.outputs.tags }}-386
|
|
||||||
73
.github/workflows/container_release3.yml
vendored
73
.github/workflows/container_release3.yml
vendored
@@ -1,73 +0,0 @@
|
|||||||
name: "docker: build release containers for rocksdb"
|
|
||||||
|
|
||||||
# DISABLED: Merged into container_release_unified.yml
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
force_run:
|
|
||||||
description: 'This workflow is disabled. Use container_release_unified.yml instead'
|
|
||||||
required: true
|
|
||||||
default: 'disabled'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build-large-release-container_rocksdb:
|
|
||||||
runs-on: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
-
|
|
||||||
name: Free Disk Space
|
|
||||||
run: |
|
|
||||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
|
||||||
sudo docker system prune -af
|
|
||||||
-
|
|
||||||
name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: chrislusf/seaweedfs
|
|
||||||
tags: type=ref,event=tag,suffix=_large_disk_rocksdb
|
|
||||||
flavor: latest=false
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.title=seaweedfs
|
|
||||||
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
|
||||||
org.opencontainers.image.vendor=Chris Lu
|
|
||||||
-
|
|
||||||
name: Create BuildKit config
|
|
||||||
run: |
|
|
||||||
cat > /tmp/buildkitd.toml <<EOF
|
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["https://mirror.gcr.io"]
|
|
||||||
EOF
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
buildkitd-config: /tmp/buildkitd.toml
|
|
||||||
-
|
|
||||||
name: Login to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./docker
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
file: ./docker/Dockerfile.rocksdb_large
|
|
||||||
build-args: |
|
|
||||||
BRANCH=${{ github.sha }}
|
|
||||||
platforms: linux/amd64
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
72
.github/workflows/container_release4.yml
vendored
72
.github/workflows/container_release4.yml
vendored
@@ -1,72 +0,0 @@
|
|||||||
name: "docker: build release containers for all tags"
|
|
||||||
|
|
||||||
# DISABLED: Merged into container_release_unified.yml
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
force_run:
|
|
||||||
description: 'This workflow is disabled. Use container_release_unified.yml instead'
|
|
||||||
required: true
|
|
||||||
default: 'disabled'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-default-release-container:
|
|
||||||
runs-on: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
-
|
|
||||||
name: Free Disk Space
|
|
||||||
run: |
|
|
||||||
echo "Before cleanup:"
|
|
||||||
df -h
|
|
||||||
sudo rm -rf /usr/share/dotnet
|
|
||||||
sudo rm -rf /usr/local/lib/android
|
|
||||||
sudo rm -rf /opt/ghc
|
|
||||||
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
|
||||||
sudo docker system prune -af
|
|
||||||
echo "After cleanup:"
|
|
||||||
df -h
|
|
||||||
-
|
|
||||||
name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
chrislusf/seaweedfs
|
|
||||||
tags: |
|
|
||||||
type=ref,event=tag,suffix=_full
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.title=seaweedfs
|
|
||||||
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
|
||||||
org.opencontainers.image.vendor=Chris Lu
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
-
|
|
||||||
name: Login to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./docker
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
file: ./docker/Dockerfile.go_build
|
|
||||||
build-args: TAGS=elastic,gocdk,rclone,sqlite,tarantool,tikv,ydb
|
|
||||||
platforms: linux/amd64
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
62
.github/workflows/container_release5.yml
vendored
62
.github/workflows/container_release5.yml
vendored
@@ -1,62 +0,0 @@
|
|||||||
name: "docker: build release containers for all tags and large volume"
|
|
||||||
|
|
||||||
# DISABLED: Merged into container_release_unified.yml
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
force_run:
|
|
||||||
description: 'This workflow is disabled. Use container_release_unified.yml instead'
|
|
||||||
required: true
|
|
||||||
default: 'disabled'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-default-release-container:
|
|
||||||
runs-on: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
-
|
|
||||||
name: Free Disk Space
|
|
||||||
run: |
|
|
||||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
|
||||||
sudo docker system prune -af
|
|
||||||
-
|
|
||||||
name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: chrislusf/seaweedfs
|
|
||||||
tags: type=ref,event=tag,suffix=_large_disk_full
|
|
||||||
flavor: latest=false
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.title=seaweedfs
|
|
||||||
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
|
||||||
org.opencontainers.image.vendor=Chris Lu
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
-
|
|
||||||
name: Login to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./docker
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
file: ./docker/Dockerfile.go_build
|
|
||||||
build-args: TAGS=5BytesOffset,elastic,gocdk,rclone,sqlite,tarantool,tikv,ydb
|
|
||||||
platforms: linux/amd64
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
17
.github/workflows/container_release_unified.yml
vendored
17
.github/workflows/container_release_unified.yml
vendored
@@ -18,6 +18,10 @@ on:
|
|||||||
- full
|
- full
|
||||||
- large_disk_full
|
- large_disk_full
|
||||||
- rocksdb
|
- rocksdb
|
||||||
|
release_tag:
|
||||||
|
description: 'Release tag to publish (e.g. 3.93)'
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
rocksdb_version:
|
rocksdb_version:
|
||||||
description: 'RocksDB git tag to use when variant=rocksdb'
|
description: 'RocksDB git tag to use when variant=rocksdb'
|
||||||
required: false
|
required: false
|
||||||
@@ -26,6 +30,9 @@ on:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref_name }}
|
||||||
|
|
||||||
# Limit concurrent builds to avoid rate limits
|
# Limit concurrent builds to avoid rate limits
|
||||||
concurrency:
|
concurrency:
|
||||||
group: release-${{ github.ref }}
|
group: release-${{ github.ref }}
|
||||||
@@ -102,7 +109,7 @@ jobs:
|
|||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
ghcr.io/chrislusf/seaweedfs
|
ghcr.io/chrislusf/seaweedfs
|
||||||
tags: type=ref,event=tag,suffix=${{ matrix.tag_suffix }}
|
tags: type=raw,value=${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }}
|
||||||
flavor: latest=false
|
flavor: latest=false
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.title=seaweedfs
|
org.opencontainers.image.title=seaweedfs
|
||||||
@@ -151,7 +158,7 @@ jobs:
|
|||||||
platforms: ${{ matrix.platforms }}
|
platforms: ${{ matrix.platforms }}
|
||||||
# Push to GHCR to avoid Docker Hub rate limits on pulls
|
# Push to GHCR to avoid Docker Hub rate limits on pulls
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/chrislusf/seaweedfs:${{ github.ref_name }}${{ matrix.tag_suffix }}
|
ghcr.io/chrislusf/seaweedfs:${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }}
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||||
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}
|
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}
|
||||||
@@ -246,8 +253,8 @@ jobs:
|
|||||||
# This is much more efficient than pulling/pushing individual arch images
|
# This is much more efficient than pulling/pushing individual arch images
|
||||||
echo "Copying ${{ matrix.variant }} from GHCR to Docker Hub..."
|
echo "Copying ${{ matrix.variant }} from GHCR to Docker Hub..."
|
||||||
retry_with_backoff crane copy \
|
retry_with_backoff crane copy \
|
||||||
ghcr.io/chrislusf/seaweedfs:${{ github.ref_name }}${{ matrix.tag_suffix }} \
|
ghcr.io/chrislusf/seaweedfs:${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }} \
|
||||||
chrislusf/seaweedfs:${{ github.ref_name }}${{ matrix.tag_suffix }}
|
chrislusf/seaweedfs:${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }}
|
||||||
|
|
||||||
echo "✓ Successfully copied ${{ matrix.variant }} to Docker Hub"
|
echo "✓ Successfully copied ${{ matrix.variant }} to Docker Hub"
|
||||||
|
|
||||||
@@ -268,5 +275,3 @@ jobs:
|
|||||||
target_dir: helm
|
target_dir: helm
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
helm_version: "3.18.4"
|
helm_version: "3.18.4"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user