惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
D
Docker
GbyAI
GbyAI
B
Blog RSS Feed
博客园 - 司徒正美
博客园 - Franky
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
aimingoo的专栏
aimingoo的专栏
C
Check Point Blog
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
AI
AI
O
OpenAI News
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
S
Secure Thoughts
博客园 - 聂微东
L
LINUX DO - 最新话题
U
Unit 42
SecWiki News
SecWiki News
A
Arctic Wolf
Schneier on Security
Schneier on Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Visual Studio Blog
量子位
The Cloudflare Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
B
Blog
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
Last Week in AI
Last Week in AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
Latest news
Latest news

kekxv 技术日志

基于 kekxv/gitea-pages 与 Gitea Actions 构建静态站点托管服务 Json简单工具 在Windows上运行Code Server:结合WSL打造你的云端VS Code开发环境 安卓sdkmanager工具换源 boost bazel starter bazel 供应商模式 PVE引导丢失修复 NSFW图像检测 警惕c++内置变量指针 关于内网springboot启动慢记录 网页转换为chrome插件 nginx代理的一种使用方式 YOLOv8 训练自己的数据 luckfox-交叉编译之bazel Linux限制进程使用率 影音中心Jellyfin快速部署 OCR & 人脸算法 -- opencv dnn tensorflow gpu 安装(ubuntu22.04) 深度学习记录-简单
gitea actions CICD 自动化
kekxv · 2023-12-15 · via kekxv 技术日志

gitea 已经支持自己的 CI 工具: gitea actions,兼容 github actions

之前使用drone搭配gitea进行自动化,效果还可以,但是终究不是官方支持。

而最新的 gitea 1.21 之后的版本,开始支持actions功能,使用方式更贴近github actions

这里做一个简单部署说明,具体的用法可以看官方文档以及github actions的用法。

效果

gitea-actions

注意事项

  1. 注意giteagitea runner之间的网络互通问题。
  2. 部署时候,需要先启动gitea,配置完成之后,拿到gitea runner注册TOKEN
  3. 如果外部端口与内部端口不一致,nginx 部分请加上对应的端口监听。
  4. 需要给gitea runner设置container network,名字查看 docker network ls
  5. gitea runner 建议设置 ENV RUNNER_TOOL_CACHE: /toolcache 方便缓存工具链。
  6. docker启动的gitea runner 不建议设置 GITEA_RUNNER_LABELS ,会导致不起作用。

将两个配置配好之后,执行启动命令,即可。

gitea/gitea/conf/app.ini 配置启用 actions

1
2
3
[actions]
ENABLED=true
DEFAULT_ACTIONS_URL=github

启动 GITEA 并获取runner token

执行 docker compose up -d gitea,正常配置完成之后,进去管理后台-》Actions-》Runners里面点击创建Runners获得Token,再将Token填入docker-compose.yaml对应配置项目,即可使用。
get_runner_token.png

docker-compose.yaml 配置参数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: "3"

services:
reverseproxy:
image: nginx:alpine
container_name: reverseproxy
restart: always
ports:
- 10080:80
dns:
- 101.101.101.101
- 8.8.8.8
- 114.114.114.114
volumes:
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./nginx/pem/:/pem/
networks:
gitea_net:
aliases:
- 定义内部域名例如:git.example.com
depends_on:
- gitea
gitea:
image: gitea/gitea:latest
container_name: gitea
dns:
- 101.101.101.101
- 8.8.8.8
- 114.114.114.114
environment:
- APP_NAME=当前的gitea名
- RUN_MODE=prod
- ROOT_URL=外部访问的地址

restart: always
networks:
- gitea_net
volumes:
- ./gitea:/data
act_runner:
image: gitea/act_runner
container_name: act_runner
dns:
- 101.101.101.101
- 8.8.8.8
- 114.114.114.114
restart: always
depends_on:
- gitea
- reverseproxy
networks:
- gitea_net
environment:
CONFIG_FILE: /config.yaml
GITEA_INSTANCE_URL: "gitea 的访问地址,也可以是内部的"
GITEA_RUNNER_REGISTRATION_TOKEN: "从启动的 Gitea 里面拿"
GITEA_RUNNER_NAME: "act_runner"


volumes:
- ./act_runner/config.yaml:/config.yaml
- ./act_runner/data:/data
- ./act_runner/cache:/root/.cache
- /var/run/docker.sock:/var/run/docker.sock
networks:
gitea_net:

gitea runner.conf 配置

路径:act_runner/config.yaml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88





log:

level: info

runner:

file: .runner

capacity: 4

envs:
RUNNER_TOOL_CACHE: /toolcache


env_file: .env



timeout: 3h

insecure: false

fetch_timeout: 5s

fetch_interval: 2s




labels: []

cache:

enabled: true


dir: ""



host: ""


port:



external_server: ""

container:



network: "实际 network 名字"

privileged: false

options:


workdir_parent:









valid_volumes: []




docker_host: ""

force_pull: false

host:


workdir_parent: