| name: Docker Image CI/CD | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 拉取源码 | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| - name: 设置 QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: 设置 Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 登录到 DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: 构建和推送 Docker hub | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/astrbot:latest | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/astrbot:${{ github.ref_name }} | |
| - name: Post build notifications | |
| run: echo "Docker image has been built and pushed successfully" | |