mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-02-03 02:23:38 +08:00
67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
# 构建Docker镜像
|
||
name: Build-Docker-Image
|
||
|
||
## 触发条件
|
||
on:
|
||
# push:
|
||
# branches:
|
||
# - master
|
||
# - next
|
||
# Publish semver tags as releases.
|
||
# tags: [ 'v*.*.*' ]
|
||
# 手动触发部署
|
||
workflow_dispatch:
|
||
# pull_request:
|
||
# branches:
|
||
# - master
|
||
# - next
|
||
|
||
## 环境变量
|
||
env:
|
||
REGISTRY: registry.cn-hangzhou.aliyuncs.com
|
||
UserName: mmdapl
|
||
|
||
jobs:
|
||
Docker-Image:
|
||
name: "构建Docker镜像"
|
||
runs-on: ubuntu-latest
|
||
if: github.repository == '142vip/408CSFamily'
|
||
permissions:
|
||
actions: read
|
||
pull-requests: read
|
||
|
||
steps:
|
||
- name: checkout code
|
||
uses: actions/checkout@v3
|
||
with:
|
||
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
|
||
fetch-depth: 0
|
||
|
||
- name: Login Docker
|
||
run: |
|
||
docker version
|
||
echo "-----------Docker Login-----------"
|
||
docker login \
|
||
--username=${{ env.UserName }} \
|
||
--password=${{ secrets.DOCKER_PASSWORD }} \
|
||
${{env.REGISTRY}}
|
||
|
||
- name: Install Node.js
|
||
uses: actions/setup-node@v3
|
||
with:
|
||
node-version: 16.20.2
|
||
|
||
- name: PNPM Install
|
||
uses: pnpm/action-setup@v2
|
||
with:
|
||
version: 7
|
||
run_install: true
|
||
|
||
## 构建,支持domain
|
||
- name: Build To Dist
|
||
run: ./scripts/bundle build_proxy
|
||
|
||
- name: Push Docker image
|
||
run: ./scripts/bundle image_faster
|
||
|