This commit is contained in:
@@ -1,19 +1,44 @@
|
||||
# 工作流名称
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
|
||||
# 运行名称:在Gitea界面中显示的具体运行名称,支持动态变量
|
||||
run-name: ${{ gitea.actor }} 正在测试 Gitea Actions 🚀
|
||||
|
||||
# 触发条件:当发生push事件时触发
|
||||
on: [push]
|
||||
|
||||
# 作业定义
|
||||
jobs:
|
||||
# 作业名称:探索Gitea Actions
|
||||
Explore-Gitea-Actions:
|
||||
# 运行环境:在ubuntu-latest标签的runner上运行
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# 步骤序列
|
||||
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 }}."
|
||||
- name: Check out repository code
|
||||
# 步骤1:输出事件信息
|
||||
- run: echo "🎉 该作业由 ${{ gitea.event_name }} 事件自动触发。"
|
||||
|
||||
# 步骤2:输出运行环境信息
|
||||
- run: echo "🐧 该作业现在正在Gitea托管的 ${{ runner.os }} 服务器上运行!"
|
||||
|
||||
# 步骤3:输出分支和仓库信息
|
||||
- run: echo "🔎 您的分支名称是 ${{ gitea.ref }},您的仓库是 ${{ gitea.repository }}。"
|
||||
|
||||
# 步骤4:检出仓库代码(具有名称的步骤)
|
||||
- name: 检出仓库代码
|
||||
uses: actions/checkout@v4
|
||||
- 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: List files in the repository
|
||||
|
||||
# 步骤5:输出克隆完成信息
|
||||
- run: echo "💡 ${{ gitea.repository }} 仓库已克隆到runner。"
|
||||
|
||||
# 步骤6:准备测试提示
|
||||
- run: echo "🖥️ 工作流现已准备好在runner上测试您的代码。"
|
||||
|
||||
# 步骤7:列出仓库文件(多行命令)
|
||||
- name: 列出仓库中的文件
|
||||
run: |
|
||||
ls ${{ gitea.workspace }}
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
|
||||
# 步骤8:输出作业状态
|
||||
- run: echo "🍏 此作业的状态是 ${{ job.status }}。"
|
||||
Reference in New Issue
Block a user