49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
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
|