ci: raw workflow + 配置适配华为云部署
build-and-deploy / build (push) Successful in 38s

This commit is contained in:
lzy
2026-07-24 00:54:01 +08:00
parent 60e18ded88
commit 57cdbe1b5b
3 changed files with 14 additions and 25 deletions
+1 -1
View File
@@ -6,4 +6,4 @@ OSS_BUCKET=official-site-base-demo
OSS_REGION=cn-hangzhou OSS_REGION=cn-hangzhou
# 本地 Gitea # 本地 Gitea
GITEA_BASE_URL=http://localhost:3000 GITEA_BASE_URL=http://localhost:3001
+10 -21
View File
@@ -8,30 +8,19 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 # raw checkout:绕开 actions/checkout(服务器拉 github action 不通)
# 仓库 publicjob 容器经 official-site_default 网络访问 gitea:3000
- uses: actions/setup-node@v4 - name: Checkout
with: run: |
node-version: '20' git config --global --add safe.directory '*'
cache: 'npm' git clone "http://gitea:3000/${GITHUB_REPOSITORY}.git" .
git checkout "${GITHUB_SHA}"
- name: Install deps - name: Install deps
run: npm ci run: npm ci --registry=https://registry.npmmirror.com
- name: Build - name: Build
run: npm run build run: npm run build
- name: Upload dist artifact - name: Verify dist
uses: actions/upload-artifact@v4 run: ls -la dist/
with:
name: dist
path: dist/
- name: Sync to OSS
env:
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }}
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
CDN_DOMAIN: ${{ secrets.CDN_DOMAIN }}
run: bash scripts/deploy-oss.sh
+3 -3
View File
@@ -3,9 +3,9 @@
# 本地验证用本地 Gitea(Task 5 起的);生产换真实 Gitea 地址 # 本地验证用本地 Gitea(Task 5 起的);生产换真实 Gitea 地址
backend: backend:
name: gitea name: gitea
repo: lzy/official-site-base repo: root/official-site-base
base_url: http://localhost:3000 base_url: http://localhost:3001
api_root: http://localhost:3000/api/v1 api_root: http://localhost:3001/api/v1
media_folder: /public/media media_folder: /public/media
public_folder: /media public_folder: /media