mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-26 22:29:56 +00:00
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
name: Docker Image CI (stable versions)
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v[0-9]*"
|
|
- "!v*alpha*"
|
|
- "!v*beta*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag version to be used for Docker image"
|
|
required: true
|
|
default: "latest"
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
usual2970/certimate
|
|
registry.cn-shanghai.aliyuncs.com/usual2970/certimate
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern=v{{version}}
|
|
type=semver,pattern=v{{major}}.{{minor}}
|
|
|
|
- name: Log in to DOCKERHUB
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
- name: Log in to ALIYUNCS
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: registry.cn-shanghai.aliyuncs.com
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|