This commit is contained in:
xiongxiao
2026-01-12 12:17:07 +08:00
parent 65056192ec
commit b239a42f39
3 changed files with 39 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ $:
script: git pull gitea main script: git pull gitea main
- name: '提交到原本的origin' - name: '提交到原本的origin'
script: git push origin main script: git push origin main
main: main:
web_trigger_sync_to_gitea: web_trigger_sync_to_gitea:
- <<: *common_sync_to_gitea - <<: *common_sync_to_gitea
@@ -60,3 +61,14 @@ main:
- <<: *common_sync_to_gitea - <<: *common_sync_to_gitea
api_trigger_sync_from_gitea: api_trigger_sync_from_gitea:
- <<: *common_sync_from_gitea - <<: *common_sync_from_gitea
push:
- services:
- docker
stages:
- name: 打包应用
script: npm run build
# 同名镜像构建&推送
- name: Docker build
script: docker build -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest .
- name: Docker push
script: docker push ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest

View File

@@ -0,0 +1,13 @@
# 使用官方 Nginx 镜像作为基础
FROM nginx:alpine
# 删除默认的 Nginx 配置
RUN rm -rf /usr/share/nginx/html/*
# 将构建好的静态文件复制到 Nginx 目录
COPY blog/public /usr/share/nginx/html
# 暴露 80 端口
EXPOSE 80
# 启动 Nginx

13
package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "@abearxiong/blog",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "cd blog && pnpm build"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.28.0"
}