mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-05 10:39:56 +00:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: Docker Image CI
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ">=1.22.5"
|
|
|
|
- name: Build certimate
|
|
run: go build -o certimate
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
registry: registry.cn-shanghai.aliyuncs.com
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract Git tag
|
|
id: get_tag
|
|
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile_build
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
registry.cn-shanghai.aliyuncs.com/usual2970/certimate:${{ env.tag }}
|
|
registry.cn-shanghai.aliyuncs.com/usual2970/certimate:latest
|