action-tester/.gitea/workflows/demo.yaml
shenjack a4bfedd811
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 26s
2023-12-10 03:34:35 +08:00

48 lines
1.6 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: node-21
# 目前稳定能使用的 runner 就是 node 21 了
steps:
- name: 各种事件展示
run: |
echo "任务是由 ${{ gitea.event_name }} 事件触发的"
echo "你的分支是 ${{ gitea.ref }}"
echo "你的仓库是 ${{ gitea.repository }}"
ls ${{ gitea.workspace }}
- name: Check out repository code
uses: http://shenjack.top:5100/gitea-server/checkout@v4
- name: 展示其他信息
run: |
echo "你的分支是 ${{ gitea.ref }}"
echo "你的仓库是 ${{ gitea.repository }}"
echo "你的仓库路径是 ${{ gitea.workspace }}"
echo "这个 Action 的运行状态是 ${{ job.status }}"
ls ${{ gitea.workspace }}
cd ${{ gitea.workspace }}
ls ..
- name: 展示 python 版本
run: |
python3 test.py
python3 -c "import sys;print(sys.version)"
python3 run.py
- name: 推送修改
run: |
git config user.name gitea-actions
git config user.email gitea-action@shenjack.top
git add .
git commit -m "auto update with Gitea Actions"
# 创建并切换到deploy分支
git checkout -b deploy
# 将更改添加到deploy分支的最新提交
git commit --amend --no-edit
# 推送到deploy分支
git push origin HEAD --force