mirror of https://github.com/certd/certd
更新CI自动创建docker工作流
parent
9633b56d47
commit
de99308a91
|
@ -5,9 +5,6 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- "build.trigger"
|
- "build.trigger"
|
||||||
|
|
||||||
# schedule:
|
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
|
||||||
# - cron: '17 19 * * *'
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
@ -31,19 +28,15 @@ jobs:
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const pnpmWorkspace = "./pnpm-workspace.yaml";
|
const pnpmWorkspace = "./pnpm-workspace.yaml";
|
||||||
fs.unlinkSync(pnpmWorkspace)
|
fs.unlinkSync(pnpmWorkspace);
|
||||||
const jsonFilePath = "./packages/ui/certd-server/package.json";
|
const jsonFilePath = "./packages/ui/certd-server/package.json";
|
||||||
const jsonContent = fs.readFileSync(jsonFilePath, 'utf-8');
|
const jsonContent = fs.readFileSync(jsonFilePath, 'utf-8');
|
||||||
const pkg = JSON.parse(jsonContent)
|
const pkg = JSON.parse(jsonContent);
|
||||||
console.log("certd_version:", pkg.version);
|
console.log("certd_version:", pkg.version);
|
||||||
return pkg.version
|
return pkg.version;
|
||||||
# - name: Use Node.js
|
|
||||||
# uses: actions/setup-node@v4
|
- name: Build Frontend
|
||||||
# with:
|
run: |
|
||||||
# node-version: 18
|
|
||||||
# cache: 'npm'
|
|
||||||
# working-directory: ./packages/ui/certd-client
|
|
||||||
- run: |
|
|
||||||
npm install -g pnpm
|
npm install -g pnpm
|
||||||
pnpm install
|
pnpm install
|
||||||
npm run build
|
npm run build
|
||||||
|
@ -55,13 +48,7 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to aliyun container Registry
|
# 只保留 Docker Hub 和 GitHub Packages 登录
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: registry.cn-shenzhen.aliyuncs.com
|
|
||||||
username: ${{ secrets.aliyun_cs_username }}
|
|
||||||
password: ${{ secrets.aliyun_cs_password }}
|
|
||||||
|
|
||||||
- name: Login to GitHub Packages
|
- name: Login to GitHub Packages
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -75,41 +62,26 @@ jobs:
|
||||||
username: ${{ secrets.dockerhub_username }}
|
username: ${{ secrets.dockerhub_username }}
|
||||||
password: ${{ secrets.dockerhub_password }}
|
password: ${{ secrets.dockerhub_password }}
|
||||||
|
|
||||||
- name: Build default platforms
|
- name: Build & Push (amd64/arm64)
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
context: ./packages/ui/
|
context: ./packages/ui/
|
||||||
tags: |
|
tags: |
|
||||||
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
Ayakasuki/certd:latest
|
||||||
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${{steps.get_certd_version.outputs.result}}
|
Ayakasuki/certd:${{ steps.get_certd_version.outputs.result }}
|
||||||
greper/certd:latest
|
|
||||||
greper/certd:${{steps.get_certd_version.outputs.result}}
|
|
||||||
ghcr.io/${{ github.repository }}:latest
|
ghcr.io/${{ github.repository }}:latest
|
||||||
ghcr.io/${{ github.repository }}:${{ steps.get_certd_version.outputs.result }}
|
ghcr.io/${{ github.repository }}:${{ steps.get_certd_version.outputs.result }}
|
||||||
- name: Build armv7
|
|
||||||
|
- name: Build & Push (armv7)
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/arm/v7
|
platforms: linux/arm/v7
|
||||||
push: true
|
push: true
|
||||||
context: ./packages/ui/
|
context: ./packages/ui/
|
||||||
tags: |
|
tags: |
|
||||||
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7
|
Ayakasuki/certd:armv7
|
||||||
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${{steps.get_certd_version.outputs.result}}-armv7
|
Ayakasuki/certd:${{ steps.get_certd_version.outputs.result }}-armv7
|
||||||
greper/certd:armv7
|
|
||||||
greper/certd:${{steps.get_certd_version.outputs.result}}-armv7
|
|
||||||
ghcr.io/${{ github.repository }}:armv7
|
ghcr.io/${{ github.repository }}:armv7
|
||||||
ghcr.io/${{ github.repository }}:${{ steps.get_certd_version.outputs.result }}-armv7
|
ghcr.io/${{ github.repository }}:${{ steps.get_certd_version.outputs.result }}-armv7
|
||||||
|
|
||||||
# - name: Build agent
|
|
||||||
# uses: docker/build-push-action@v6
|
|
||||||
# with:
|
|
||||||
# platforms: linux/amd64,linux/arm64
|
|
||||||
# push: true
|
|
||||||
# context: ./packages/ui/agent/
|
|
||||||
# tags: |
|
|
||||||
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:latest
|
|
||||||
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:${{steps.get_certd_version.outputs.result}}
|
|
||||||
# greper/certd-agent:latest
|
|
||||||
# greper/certd-agent:${{steps.get_certd_version.outputs.result}}
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
name: sync-to-gitee-dev
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ['v2-dev']
|
|
||||||
# schedule:
|
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
|
||||||
# - cron: '17 19 * * *'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
lfs: true
|
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
|
||||||
run: |
|
|
||||||
git config --global user.name "xiaojunnuo"
|
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
|
||||||
with: # token 格式为: username:password
|
|
||||||
credentials: https://${{secrets.PUSH_TOKEN_GITEE}}@gitee.com
|
|
||||||
|
|
||||||
- name: push to gitee # 4. 执行同步
|
|
||||||
run: |
|
|
||||||
git remote add upstream https://gitee.com/certd/certd
|
|
||||||
git push --set-upstream upstream v2-dev
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
name: sync-to-gitee
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ['v2']
|
|
||||||
# schedule:
|
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
|
||||||
# - cron: '17 19 * * *'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
lfs: true
|
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
|
||||||
run: |
|
|
||||||
git config --global user.name "xiaojunnuo"
|
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
|
||||||
with: # token 格式为: username:password
|
|
||||||
credentials: https://${{secrets.PUSH_TOKEN_GITEE}}@gitee.com
|
|
||||||
|
|
||||||
- name: push to gitee # 4. 执行同步
|
|
||||||
run: |
|
|
||||||
git remote add upstream https://gitee.com/certd/certd
|
|
||||||
git push --set-upstream upstream v2
|
|
||||||
|
|
Loading…
Reference in New Issue