feat:add aliyun oss deploy
This commit is contained in:
52
.github/workflows/deploy-pages.yml
vendored
52
.github/workflows/deploy-pages.yml
vendored
@@ -40,12 +40,6 @@ jobs:
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
|
||||
- name: Upload dist artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-dist
|
||||
path: ./dist
|
||||
|
||||
- name: Deploy to OSS + Refresh CDN
|
||||
run: pnpm run deploy-oss
|
||||
env:
|
||||
@@ -55,46 +49,6 @@ jobs:
|
||||
OSS_REGION: ${{ secrets.OSS_REGION }}
|
||||
CDN_DOMAIN: ${{ secrets.CDN_DOMAIN }}
|
||||
|
||||
# deploy-pages:
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: build
|
||||
# steps:
|
||||
# - name: Download build artifact
|
||||
# uses: actions/download-artifact@v4
|
||||
# with:
|
||||
# name: build-dist
|
||||
# path: dist
|
||||
#
|
||||
# - name: Setup Pages
|
||||
# uses: actions/configure-pages@v4
|
||||
#
|
||||
# - name: Upload artifact for Pages
|
||||
# uses: actions/upload-pages-artifact@v3
|
||||
# with:
|
||||
# path: './dist'
|
||||
#
|
||||
# - name: Deploy to GitHub Pages
|
||||
# id: deployment
|
||||
# uses: actions/deploy-pages@v4
|
||||
|
||||
# deploy-oss:
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: build
|
||||
# steps:
|
||||
# - name: Download build artifact
|
||||
# uses: actions/download-artifact@v4
|
||||
# with:
|
||||
# name: build-dist
|
||||
# path: dist
|
||||
#
|
||||
# - name: Install OSS SDK
|
||||
# run: npm install ali-oss @alicloud/pop-core
|
||||
#
|
||||
# - name: Deploy to OSS + Refresh CDN
|
||||
# run: pnpm run deploy-oss
|
||||
# env:
|
||||
# OSS_KEY_ID: ${{ secrets.OSS_KEY_ID }}
|
||||
# OSS_KEY_SECRET: ${{ secrets.OSS_KEY_SECRET }}
|
||||
# OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
|
||||
# OSS_REGION: ${{ secrets.OSS_REGION }}
|
||||
# CDN_DOMAIN: ${{ secrets.CDN_DOMAIN }}
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
@@ -68,7 +68,7 @@ async function refreshCDN() {
|
||||
ObjectPath: `https://${CDN_DOMAIN}/*`,
|
||||
ObjectType: 'File'
|
||||
}
|
||||
const requestOption = { method: 'POST' }
|
||||
const requestOption = {method: 'POST'}
|
||||
const result = await cdnClient.request('RefreshObjectCaches', params, requestOption)
|
||||
console.log('✅ CDN 刷新完成:', result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user