From a942019c81a593ce103083ea3ab443acd76f31de Mon Sep 17 00:00:00 2001 From: UnknownMp Date: Fri, 23 May 2025 18:47:41 +0800 Subject: [PATCH] =?UTF-8?q?[Base]=20=E6=9B=B4=E6=96=B0=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2b8394a..c13d4ed 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -3,13 +3,29 @@ name: Node.js CI on: push: tags: - - 'v*' # 匹配所有 tag(也可改为 v* 等更具体的匹配) + - 'v*' jobs: build-and-test: runs-on: ubuntu-latest steps: + - name: 获取 Tag 名称 + id: extract_tag + run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT + + - name: 通知:开始构建 + run: | + TAG=${{ steps.extract_tag.outputs.tag }} + curl -X POST http://10.0.0.3:52222/send \ + -H "Content-Type: application/json" \ + -d @- <> ~/.ssh/config echo " UserKnownHostsFile=/dev/null" >> ~/.ssh/config - - name: 获取 Tag 名称 - id: extract_tag - run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT - name: 上传产物到远程服务器 run: | @@ -59,4 +84,14 @@ jobs: scp output.zip default@10.0.0.3:/srv/publish/ao3-mirror-ssr/${TAG}.zip ssh default@10.0.0.3 sh -c 'cd /srv/publish/ao3-mirror-ssr/; rm -f latest.zip; ln -s ${TAG}.zip latest.zip' - + - name: 通知:上传完成 + run: | + TAG=${{ steps.extract_tag.outputs.tag }} + curl -X POST http://10.0.0.3:52222/send \ + -H "Content-Type: application/json" \ + -d @- <