how-to-use/README.md
mrbbbaixue 5dd690ed4d
All checks were successful
Gitea Actions 示例 / example (push) Successful in 20s
改名字
2025-04-29 11:23:38 +08:00

35 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Gitea Actions 使用指南
![](https://git.ra3battle.cn/actions/how-to-use/actions/workflows/example.yml/badge.svg?branch=master)
## 示例说明
1. 本示例展示如何:
- 输出README.md文件内容
- 上传README.md作为artifacts
## 配置文件解析
详细解释example.yml的每个部分:
- `on`: 定义触发条件当main分支有push时触发
- `jobs`: 定义任务包含一个名为example的任务
- `steps`: 执行步骤,包含:
- 检出代码
- 输出README内容
- 上传Artifacts
## 示例使用方法
1. 将example.yml文件放入.gitea/workflows/目录
2. 推送代码到main分支
3. 在Gitea的Actions页面查看执行结果
4. 在Artifacts部分下载打包文件
> 注意请使用本站地址来指定Actions镜像例如
> `https://git.ra3battle.cn/actions/upload-artifact`
>
> 对于upload-artifact和download-artifact必须要使用镜像版本否则会出现错误
## 更多资源
- [Gitea官方Actions示例文档](https://docs.gitea.com/zh-cn/usage/actions/act-runner)
## 自定义配置
- 要修改触发分支,编辑`branches`部分
- 要修改artifacts名称编辑`name`参数