GitHub Actions
跳转到导航
跳转到搜索
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。
相关连结
外部连结
- 官方网站 (英文)