forked from Jingye-Xia/ActionsVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a2fdca7
Showing
10 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# https://github.com/P3TERX/ActionsVM | ||
|
||
name: Ubuntu (ngrok) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Instance: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Run Start Script | ||
run: source ubuntu-start.sh | ||
|
||
- name: Start SSH via ngrok | ||
uses: P3TERX/ssh2actions@main | ||
with: | ||
mode: ngrok | ||
env: | ||
NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }} | ||
NGROK_REGION: jp | ||
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
- name: Run End Script | ||
run: source ubuntu-end.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# https://github.com/P3TERX/ActionsVM | ||
|
||
name: Ubuntu (tmate) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Instance: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Run Start Script | ||
run: source ubuntu-start.sh | ||
|
||
- name: Start SSH via tmate | ||
uses: P3TERX/ssh2actions@main | ||
env: | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
- name: Run End Script | ||
run: source ubuntu-end.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# https://github.com/P3TERX/ActionsVM | ||
|
||
name: macOS (ngrok) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Instance: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Run Start Script | ||
run: source macos-start.sh | ||
|
||
- name: Start SSH via ngrok | ||
uses: P3TERX/ssh2actions@main | ||
with: | ||
mode: ngrok | ||
env: | ||
NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }} | ||
NGROK_REGION: jp | ||
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
- name: Run End Script | ||
run: source macos-end.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# https://github.com/P3TERX/ActionsVM | ||
|
||
name: macOS (tmate) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Instance: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Run Start Script | ||
run: source macos-start.sh | ||
|
||
- name: Start SSH via tmate | ||
uses: P3TERX/ssh2actions@main | ||
env: | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
- name: Run End Script | ||
run: source macos-end.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 P3TERX <https://p3terx.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# ActionsVM | ||
|
||
[](https://github.com/P3TERX/ActionsVM/blob/master/LICENSE) | ||
 | ||
 | ||
|
||
Connect to GitHub Actions via SSH, get macOS or Linux VM for free. | ||
|
||
## Usage | ||
|
||
- Click the [Use this template](https://github.com/P3TERX/ActionsVM/generate) button to create a new repository. | ||
- Select `macOS (tmate)` or `Ubuntu (tmate)` on the Actions page. | ||
- Click the `Run workflow` button. | ||
- Get the connection info in the log. | ||
|
||
## TIPS | ||
|
||
- Note that your repo needs to be public, otherwise you have a strict monthly limit on how many minutes you can use. | ||
- Your session can run for up to six hours. Don't forget to close it after finishing your work, otherwise you will continue to occupy this virtual machine, making it impossible for others to use it normally. | ||
- Please check the [GitHub Actions Terms of Service](https://docs.github.com/en/github/site-policy/github-additional-product-terms#5-actions-and-packages). According to the TOS the repo that contains these files needs to be the same one where you're developing the project that you're using it for, and specifically that you are using it for the "*production, testing, deployment, or publication of [that] software project*". | ||
|
||
## Advanced | ||
|
||
### SSH by using [ngrok](https://ngrok.com/) | ||
|
||
Click the `Settings` tab on your own repository, and then click the `Secrets` button to add the following encrypted environment variables: | ||
|
||
- `NGROK_TOKEN`: Sign up on the https://ngrok.com , find this token [here](https://dashboard.ngrok.com/auth/your-authtoken). | ||
- `SSH_PASSWORD`: This password you will use when authorizing via SSH. | ||
|
||
### Send connection info to [Telegram](https://telegram.org/) | ||
|
||
Click the `Settings` tab on your own repository, and then click the `Secrets` button to add the following encrypted environment variables: | ||
|
||
- `TELEGRAM_BOT_TOKEN`: Get your bot token by talking to [@BotFather](https://t.me/botfather). | ||
- `TELEGRAM_CHAT_ID`: Get your chat ID by talking to [@GetMyID_bot](https://t.me/getmyid_bot) or other similar bots. | ||
|
||
You can find Telegram Bot related documents [here](https://core.telegram.org/bots). | ||
|
||
## Licence | ||
|
||
[MIT](https://github.com/P3TERX/ActionsVM/blob/main/LICENSE) © P3TERX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This script runs after SSH in macOS instances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This script runs before SSH in macOS instances | ||
|
||
## Example ## | ||
|
||
# Setting the time zone | ||
#sudo systemsetup -settimezone "Asia/Shanghai" | ||
|
||
# Install the tools you need to use | ||
#brew install neofetch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This script runs after SSH in Ubuntu instances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This script runs before SSH in Ubuntu instances | ||
|
||
## Example ## | ||
|
||
# Setting the time zone | ||
#sudo timedatectl set-timezone "Asia/Shanghai" | ||
|
||
# Install the tools you need to use | ||
#sudo apt update | ||
#sudo apt install -y neofetch |