Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Daily Docker AIO Build #11

Daily Docker AIO Build

Daily Docker AIO Build #11

Workflow file for this run

name: Daily Docker AIO Build
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # 每天UTC时间0:00运行
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ORG_NAME: ilovescratch2 # 全部小写
IMAGE_NAME: openlistbuilder
REGISTRY: ghcr.io
ARTIFACT_NAME: 'daily_binaries'
RELEASE_PLATFORMS: 'linux/amd64,linux/arm64'
jobs:
build_binary:
name: Build Binaries
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Cache Musl libraries
id: cache-musl
uses: actions/cache@v4
with:
path: build/musl-libs
key: daily-musl-${{ hashFiles('build.sh') }}-v3
- name: Download Musl (if not cached)
if: steps.cache-musl.outputs.cache-hit != 'true'
run: bash build.sh prepare docker-multiplatform
- name: Build Daily Binary
run: bash build.sh beta docker-multiplatform
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
build/
!build/*.tgz
!build/musl-libs/**
build_and_push_aio:
needs: build_binary
name: Build and Push AIO Image
runs-on: ubuntu-latest
steps:
- name: Get current UTC timestamp
id: timestamp
run: |
# 生成完全兼容的 Docker 标签格式
TIMESTAMP=$(date -u +'%Y%m%d-%H%M%S')
echo "TAG=openlistbuilder-$TIMESTAMP" >> $GITHUB_OUTPUT
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
- name: Download Binaries
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: network=host
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push AIO Image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.ci
push: true
build-args: |
INSTALL_FFMPEG=true
INSTALL_ARIA2=true
tags: |
${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.TAG }}
platforms: ${{ env.RELEASE_PLATFORMS }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: Verify Image Push
run: |
echo "Successfully pushed image:"
echo "${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.TAG }}"
echo "You can find it at:"
echo "https://github.com/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}/pkgs/container/${{ env.IMAGE_NAME }}"