This commit is contained in:
+1
-1
@@ -6,4 +6,4 @@ OSS_BUCKET=official-site-base-demo
|
||||
OSS_REGION=cn-hangzhou
|
||||
|
||||
# 本地 Gitea
|
||||
GITEA_BASE_URL=http://localhost:3000
|
||||
GITEA_BASE_URL=http://localhost:3001
|
||||
|
||||
+10
-21
@@ -8,30 +8,19 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
# raw checkout:绕开 actions/checkout(服务器拉 github action 不通)
|
||||
# 仓库 public,job 容器经 official-site_default 网络访问 gitea:3000
|
||||
- name: Checkout
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
git clone "http://gitea:3000/${GITHUB_REPOSITORY}.git" .
|
||||
git checkout "${GITHUB_SHA}"
|
||||
|
||||
- name: Install deps
|
||||
run: npm ci
|
||||
run: npm ci --registry=https://registry.npmmirror.com
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Upload dist artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
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
|
||||
- name: Verify dist
|
||||
run: ls -la dist/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
# 本地验证用本地 Gitea(Task 5 起的);生产换真实 Gitea 地址
|
||||
backend:
|
||||
name: gitea
|
||||
repo: lzy/official-site-base
|
||||
base_url: http://localhost:3000
|
||||
api_root: http://localhost:3000/api/v1
|
||||
repo: root/official-site-base
|
||||
base_url: http://localhost:3001
|
||||
api_root: http://localhost:3001/api/v1
|
||||
|
||||
media_folder: /public/media
|
||||
public_folder: /media
|
||||
|
||||
Reference in New Issue
Block a user