This commit is contained in:
parent
06835b2bf1
commit
93234fbbe2
48
.gitea/workflows/deploy.yaml
Normal file
48
.gitea/workflows/deploy.yaml
Normal file
@ -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
|
||||||
Loading…
x
Reference in New Issue
Block a user