mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
CI: 替换 Drone CI 为 Gitea 内建的 Actions (#80)
自动构建相关。 Reviewed-on: https://git.unlock-music.dev/um/um-react/pulls/80 Co-authored-by: 鲁树人 <lu.shuren@um-react.app> Co-committed-by: 鲁树人 <lu.shuren@um-react.app>
This commit is contained in:
34
.gitea/workflows/build.yaml
Normal file
34
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Build and Deploy
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
npm_config_registry: https://registry.npmmirror.com
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
standalone: true
|
||||
run_install: |
|
||||
- args: [--frozen-lockfile, --strict-peer-dependencies]
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Prepare for deployment
|
||||
run: |
|
||||
python3 -m zipfile -c um-react.zip dist/.
|
||||
cp um-react.zip dist/"release-${GITHUB_SHA}.zip"
|
||||
python3 -m zipfile -c um-react-site.zip dist/.
|
||||
- name: Publish Artifact
|
||||
uses: christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: site
|
||||
path: dist/
|
||||
- name: Deploy
|
||||
env:
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
NETLIFY_API_KEY: ${{ secrets.NETLIFY_API_KEY }}
|
||||
run: ./scripts/deploy.sh
|
||||
Reference in New Issue
Block a user