- Change docker-build.yml trigger from push-to-main to release-published and workflow_dispatch for more controlled builds - Add hitokoto API integration to release workflow for dynamic release names Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Docker image build
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Check for Docker Hub credentials
|
|
id: docker_creds
|
|
run: |
|
|
if [ -z "${{ secrets.DOCKERHUB_USERNAME }}" ] || [ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]; then
|
|
echo "Docker Hub credentials not found, skipping login and push."
|
|
echo "has_creds=false" >> $GITHUB_ENV
|
|
else
|
|
echo "has_creds=true" >> $GITHUB_ENV
|
|
fi
|
|
-
|
|
name: Login to Docker Hub
|
|
if: env.has_creds == 'true'
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
if: env.has_creds == 'true'
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: zaunist/xugou:latest |