mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-08 07:04:49 +08:00
105 lines
2.5 KiB
YAML
105 lines
2.5 KiB
YAML
name: Docker Image CI (preview versions)
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v[0-9]*-alpha*"
|
|
- "v[0-9]*-beta*"
|
|
- "v[0-9]*-rc*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag version to be used for Docker image"
|
|
required: true
|
|
default: "next"
|
|
|
|
jobs:
|
|
prepare-ui:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
persist-credentials: false
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Build UI
|
|
run: |
|
|
npm --prefix=./ui ci
|
|
npm --prefix=./ui run build
|
|
|
|
- name: Upload UI build artifacts
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: ui-build
|
|
path: ./ui/dist
|
|
retention-days: 1
|
|
|
|
build-and-push:
|
|
needs: prepare-ui
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
persist-credentials: false
|
|
|
|
- name: Free disk space
|
|
uses: BRAINSia/free-disk-space@v2
|
|
with:
|
|
tool-cache: false
|
|
|
|
- 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: |
|
|
certimate/certimate
|
|
registry.cn-shanghai.aliyuncs.com/certimate/certimate
|
|
tags: |
|
|
type=ref,event=tag,pattern={{version}}
|
|
type=raw,value=next
|
|
flavor: |
|
|
latest=false
|
|
|
|
- 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: Download UI build artifacts
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: ui-build
|
|
path: ./ui/dist
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
# file: ./Dockerfile
|
|
file: ./Dockerfile.gh
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|