From 5c42b897c2ae3d952dffe9008dc1a63eb4086ee8 Mon Sep 17 00:00:00 2001 From: DVKunion <2622100059@qq.com> Date: Thu, 23 Feb 2023 15:12:36 +0800 Subject: [PATCH] init --- .github/workflows/example.yml | 11 +++++++++++ .gitignore | 1 + README.md | 36 +++++++++++++++++++++++++++++++++++ action.yml | 17 +++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 .github/workflows/example.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 action.yml diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 0000000..eed9b0e --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,11 @@ +## entry +#name: example +##on: [ push, pull_request ] +#on: +# workflow_dispatch: +# +#jobs: +# test: +# runs-on: ubuntu-20.04 +# steps: +# - use: \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..79914ae --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Collie Tricker + +通过 GitHub Action 白嫖国外主机。 + +## 使用方式 + +1. 注册百川-使用牧云主机管理助手 + +![](https://cdn.dvkunion.cn/tricker/46fd1775808c4411b8c2f1225641289f.png) + +2. 点击绑定主机 + +![](https://cdn.dvkunion.cn/tricker/b61fa3cb6f0f4069b60c99a48be599aa.png) + +3. 获取token + +![](https://cdn.dvkunion.cn/tricker/09d9e9ee0809482faf54b491e42ae7d8.png) + + +4. 在github创建一个空的仓库,clone到本地,并创建`.github/workflows/workflow.yml`文件,写入一下参考内容: + +```yml + +``` + +5. git push 上去代码,触发action。 + +6. 返回百川界面,已获取到主机。 + +7. 后续使用时可以通过手动触发action的方式。 + +## 一些更有趣的玩法 + +一些更便捷的方式,如果需求的人多会逐步加入到demo。 + ++ 可以使用github action 的`on:workflow_dispatch`,通过http请求触发ci,来实现主机上线控制。 \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..f5958df --- /dev/null +++ b/action.yml @@ -0,0 +1,17 @@ +name: 'Collie' +description: 'Use Collie to get an free host' +author: 'DVK' +branding: + color: gray-dark + icon: heart +inputs: + token: + description: 'your collie token' + default: '' +runs: + using: 'composite' + steps: + - run: curl -kfsSL 'http://collie-agent.chaitin.com:1443/api/v1/host/install_script?os_type=linux' | sudo bash -s -- --token={{ inputs.token }} + shell: bash + - run: sleep 360 + shell: bash \ No newline at end of file