Skip to content

Update go_build_test.yml #106

Update go_build_test.yml

Update go_build_test.yml #106

name: Build And Push Docker Image
on:
push:
branches:
- dev
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ygxb/qqbot-go
tags: |
latest
dev
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Get date
id: date
run: echo now=$(TZ=Asia/Shanghai date +"%Y-%m-%d %H:%M:%S") >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: now=${{ steps.date.outputs.now }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6