Skip to content

ci(docker): 添加 compose back 配置,支持多平台构建 #10

ci(docker): 添加 compose back 配置,支持多平台构建

ci(docker): 添加 compose back 配置,支持多平台构建 #10

name: Build and Push Docker Images on Tag
on:
push:
tags:
- '*'
permissions:
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Make build script executable
run: chmod +x scripts/docker-build.sh
- name: Build and push images using script
env:
CI: 'true'
AUTO_PUSH: 'true'
VERSION: ${{ github.ref_name }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# 开启 Compose Bake
COMPOSE_BAKE: 'true'
run: |
./scripts/docker-build.sh "$VERSION" "$DOCKERHUB_USERNAME"