GitHub Actions:修订间差异
跳到导航
跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
(创建页面,内容为“'''GitHub Actions'''是GitHub == 相關連結 == * GitHub == 外部連結 == * {{Official|https://github.com/features/actions}} {{en}}”) |
(→範例) |
||
(未显示同一用户的18个中间版本) | |||
第1行: | 第1行: | ||
'''GitHub Actions'''是[[GitHub]] | '''GitHub Actions'''是[[GitHub]] 提供的CI/CD服務。 | ||
== 範例 == | |||
=== test-githubactions === | |||
在[https://github.com/gslin/test-githubactions test-githubactions]這邊的範例是透過[[SSH]]與[[rsync]]將程式碼推到一台機器上(目前的程式碼內不支援多機)透過[[systemd]]跑起來,主要是這兩個檔案: | |||
* https://github.com/gslin/test-githubactions/blob/main/.github/workflows/default.yml | |||
* https://github.com/gslin/test-githubactions/blob/main/scripts/setup.sh | |||
==== 前置作業 ==== | |||
* 設定佈署需要的SSH key: | |||
<syntaxhighlight lang="bash"> | |||
cat ~/.ssh/deploy.pem | base64 -w 0 | gh secret set DEPLOY_SSH_PRIVATE_KEY_BASE64 | |||
</syntaxhighlight> | |||
* 修改<code>/etc/ssh/sshd_config</code>,讓SSH的Port 222要打開。 | |||
* 建立<code>service-${PROJECT_NAME}</code>帳號及對應家目錄。 | |||
* 透過<code>sudo loginctl enable-linger service-${PROJECT_NAME}</code>啟用使用者本身的[[systemd]]。 | |||
== 相關連結 == | == 相關連結 == | ||
第8行: | 第29行: | ||
* {{Official|https://github.com/features/actions}} {{en}} | * {{Official|https://github.com/features/actions}} {{en}} | ||
[[Category:服務]] |
2024年6月14日 (五) 08:26的最新版本
GitHub Actions是GitHub提供的CI/CD服务。
范例
test-githubactions
在test-githubactions这边的范例是透过SSH与rsync将程式码推到一台机器上(目前的程式码内不支援多机)透过systemd跑起来,主要是这两个档案:
- https://github.com/gslin/test-githubactions/blob/main/.github/workflows/default.yml
- https://github.com/gslin/test-githubactions/blob/main/scripts/setup.sh
前置作业
- 设定布署需要的SSH key:
cat ~/.ssh/deploy.pem | base64 -w 0 | gh secret set DEPLOY_SSH_PRIVATE_KEY_BASE64
- 修改
/etc/ssh/sshd_config
,让SSH的Port 222要打开。 - 建立
service-${PROJECT_NAME}
账号及对应家目录。 - 透过
sudo loginctl enable-linger service-${PROJECT_NAME}
启用使用者本身的systemd。
相关连结
外部链接
- 官方网站 (英文)