Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38faf9184a | ||
|
|
450c9cda48 | ||
| 57f7e71706 | |||
| 82df985c2a | |||
| e44b0304fc |
@ -1,3 +1,4 @@
|
|||||||
|
# deployed by gitea act_runner (push to main/dev triggers this)
|
||||||
name: Build and Deploy (tool.xpcool.com)
|
name: Build and Deploy (tool.xpcool.com)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@ -9,13 +10,24 @@ jobs:
|
|||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install git (node image has no git)
|
- name: Install git (Tencent mirror apt)
|
||||||
run: apt-get update && apt-get install -y git
|
run: |
|
||||||
|
sed -i 's|deb.debian.org|mirrors.cloud.tencent.com|g; s|security.debian.org|mirrors.cloud.tencent.com|g' /etc/apt/sources.list 2>/dev/null || true
|
||||||
|
sed -i 's|deb.debian.org|mirrors.cloud.tencent.com|g; s|security.debian.org|mirrors.cloud.tencent.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || true
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y git
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout (local Gitea, no external actions)
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git clone --depth 1 --branch "${{ github.ref_name }}" https://oauth2:${{ github.token }}@git.xpcool.com/${{ github.repository }}.git .
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Use npmmirror registry (faster in CN)
|
||||||
|
run: npm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
- name: Enable pnpm via corepack
|
- name: Enable pnpm via corepack
|
||||||
|
env:
|
||||||
|
COREPACK_NPM_REGISTRY: https://registry.npmmirror.com
|
||||||
run: |
|
run: |
|
||||||
corepack enable
|
corepack enable
|
||||||
corepack prepare pnpm@10 --activate
|
corepack prepare pnpm@10 --activate
|
||||||
@ -40,3 +52,17 @@ jobs:
|
|||||||
cp -r "$SRC"/. "$DST"/
|
cp -r "$SRC"/. "$DST"/
|
||||||
chmod -R a+rX "$DST"
|
chmod -R a+rX "$DST"
|
||||||
echo "Deployed tool.xpcool.com -> $DST"
|
echo "Deployed tool.xpcool.com -> $DST"
|
||||||
|
|
||||||
|
- name: Notify success (PushPlus)
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
curl -s -X POST "https://www.pushplus.plus/send" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"token":"${{ secrets.PUSHPLUS_TOKEN }}","title":"✅ 部署成功 tool.xpcool.com","content":"仓库: ${{ github.repository }}<br>分支: ${{ github.ref_name }}<br>提交: ${{ github.sha }}<br>触发人: ${{ github.actor }}<br>状态: 编译打包部署成功<br>访问: https://tool.xpcool.com","template":"html"}'
|
||||||
|
|
||||||
|
- name: Notify failure (PushPlus)
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
curl -s -X POST "https://www.pushplus.plus/send" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"token":"${{ secrets.PUSHPLUS_TOKEN }}","title":"❌ 部署失败 tool.xpcool.com","content":"仓库: ${{ github.repository }}<br>分支: ${{ github.ref_name }}<br>提交: ${{ github.sha }}<br>触发人: ${{ github.actor }}<br>状态: 构建或部署失败<br>日志: https://git.xpcool.com/${{ github.repository }}/actions","template":"html"}'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user