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."
|
|
|
|
# 设置环境和 Node.js
|
|
- name: Setup environment
|
|
run: |
|
|
export NVM_DIR="$HOME/.nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
unset CI
|
|
nvm use 23.5.0
|
|
|
|
- name: Compile code and build
|
|
run: |
|
|
export NVM_DIR="$HOME/.nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
unset CI
|
|
nvm use 22.14.0
|
|
yarn
|
|
yarn build
|
|
cd dist/
|
|
zip -r study-online.zip .
|
|
mv study-online.zip /yantoo/pkg/
|
|
sh /yantoo/bin/front.sh
|
|
|
|
echo "Files successfully moved to /yantoo/frontend/study-online/"
|