This commit is contained in:
+1
-1
@@ -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
@@ -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 不通)
|
||||||
|
# 仓库 public,job 容器经 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,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
|
||||||
|
|||||||
Reference in New Issue
Block a user