From c74b2331bcf62016c6410161b28c21c7b74a851d Mon Sep 17 00:00:00 2001 From: lzy Date: Thu, 23 Jul 2026 19:17:09 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20Gitea=20Action=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E5=B8=83=E5=88=B0=20OSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..e21d363 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,37 @@ +name: build-and-deploy + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install deps + run: npm ci + + - 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