From 93234fbbe217479188389b44d2e8fad76c9aedde Mon Sep 17 00:00:00 2001 From: libingxiang Date: Mon, 4 Aug 2025 16:16:20 +0800 Subject: [PATCH] ci --- .gitea/workflows/deploy.yaml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..7a06d43 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,48 @@ +name: study-online +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: + push: + branches: + - master + - "release**" + +env: + BUILD: staging + +jobs: + Explore-Gitea-Actions: + runs-on: stream9 + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - run: echo "Gitea job id ${{ gitea.run_id }}." + - name: Check out repository code + uses: https://gitea.yantootech.com/neil/checkout@v4 + with: + fetch-depth: 1 + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + + # 前端项目构建步骤 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '23.5.0' # 根据项目需求调整Node版本 + + - name: Install dependencies + run: npm install # 或者 yarn install + + - name: Build project + run: npm run build # 或者 yarn build,根据package.json中的脚本调整 + + - name: Package dist folder + run: | + zip -r frontend-dist.zip dist + mv frontend-dist.zip /yantoo/frontend/ + + - name: Extract package in target directory + run: | + cd /yantoo/frontend/ + unzip -o frontend-dist.zip + rm frontend-dist.zip