From 66e4bf6e895830f185dde964aeed83c07cd127db Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 10 Oct 2026 16:02:39 +0800 Subject: [PATCH] =?UTF-8?q?init:=20=E8=87=AA=E5=8A=A8=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 25 +++++++++++++++++++++++++ index.html | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 index.html diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..41112f6 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: 自动部署示例 + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: 拉取代码 + uses: actions/checkout@v4 + + - name: 发布到 nginx 网页目录 + run: | + set -e + DEST=/sites/demo-deploy + mkdir -p "$DEST" + # 纯静态:直接同步。如果是需要构建的前端,改成: + # npm ci && npm run build && cp -r dist/* "$DEST"/ + cp -r ./* "$DEST"/ + # 注入本次构建时间,方便肉眼确认每次 push 都更新了 + sed -i "s/__DEPLOY_TIME__/$(date '+%F %T')/" "$DEST/index.html" + echo "已发布到 $DEST" + ls -l "$DEST" diff --git a/index.html b/index.html new file mode 100644 index 0000000..7437375 --- /dev/null +++ b/index.html @@ -0,0 +1,23 @@ + + + + + + 自动部署示例 + + + +
+

自动部署成功

+

这个页面由 Gitea Actions 在每次 git push 后自动发布,无需手动操作。

+
本次部署时间:__DEPLOY_TIME__
+
+ +