From 515ce1f1c1dcd44d317c00371003a0ff85e61c40 Mon Sep 17 00:00:00 2001 From: Ayaka Date: Wed, 4 Sep 2024 00:59:10 +0100 Subject: [PATCH] Try fix deployment --- .github/workflows/publish.yml | 28 ++++++++++------------------ vite.cos.config.ts | 2 +- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 782c845..17f8578 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,24 +15,16 @@ jobs: node-version: 22 - run: npm ci - run: npm test - # FIXME CORS broken, building non-COS version for now - #- run: npm run build:cos - - run: npm run build - # FIXME CORS broken, deploying everything on GH Pages for now - #- name: Install coscmd - # run: sudo pip install coscmd - #- name: Configure coscmd - # env: - # SECRET_ID: ${{ secrets.SecretId }} - # SECRET_KEY: ${{ secrets.SecretKey }} - # BUCKET: ${{ secrets.Bucket }} - # REGION: ${{ secrets.Region }} - # run: coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION - #- name: Publish static files to COS - # run: | - # cd ./build/ - # coscmd upload -rs --delete -f ./ / --ignore index.html - # rm -rf assets + - run: npm run build:cos + - name: Install coscmd + run: sudo pip install coscmd + - name: Configure coscmd + run: coscmd config -a ${{ secrets.SecretId }} -s $${{ secrets.SecretKey }} -b $${{ vars.BUCKET }} -r $${{ vars.REGION }} + - name: Publish static files to COS + run: | + cd ./build/ + coscmd upload -rs --delete -f ./ / --ignore index.html + rm -rf !(index.html) - name: Publish to GitHub Pages run: | # Create a temporary directory diff --git a/vite.cos.config.ts b/vite.cos.config.ts index fd6971a..09482b0 100644 --- a/vite.cos.config.ts +++ b/vite.cos.config.ts @@ -1,4 +1,4 @@ import { makeConfig } from "./vite.config"; // Same as base config but prefix each asset path in index.html with this location -export default makeConfig("https://qieyun-autoderiver-1305783649.file.myqcloud.com/"); +export default makeConfig("https://autoderiver-1305783649.cos.accelerate.myqcloud.com/");