Skip to content

Commit

Permalink
update ngrok setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBlake-zkq committed Jan 18, 2024
1 parent 831feec commit 6c2e775
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ on: [workflow_dispatch]
jobs:
run-server:
name: run mc serv and open ngrok tunnel
runs-on: ubuntu-latest
if: ${{ always() }}
runs-on: ubuntu-20.04
steps:
- name: start mc server container
run: |
docker run -itd --name mcserv --rm \
docker run -itd --name mc --rm \
-p 25565:25565 \
-e START_COMMAND="${{ vars.START_COMMAND }}" \
-e S3_BUCKET_NAME=${{ vars.S3_BUCKET_NAME }} \
Expand All @@ -17,10 +16,15 @@ jobs:
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
${{ github.event.act && 'localhost:8080' || 'ghcr.io' }}/${{ vars.IMAGE_REPO }}:latest
- name: install and configure ngrok
- name: install ngrok
run: |
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-${{ vars.ARCHITECTURE || 'amd64' }}.tgz
tar -xvf ngrok-v3-stable-linux-${{ vars.ARCHITECTURE || 'amd64' }}.tgz
./ngrok config add-authtoken ${{ secrets.NGROK_AUTHTOKEN }}
# - name: setup ssh server
# run: |
# echo "${{ secrets.PUBLIC_KEY }}" >> ~/.ssh/authorized_keys
# sudo chmod -R go= ~/.ssh
# service ssh restart
- uses: actions/checkout@v2
- name: open ngrok tunnel
run: ./ngrok tcp 25565 --log stdout
run: ./ngrok start --all --config ngrok-config.yaml --authtoken ${{ secrets.NGROK_AUTHTOKEN }}
9 changes: 9 additions & 0 deletions ngrok-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tunnels:
# ssh:
# proto: tcp
# addr: 22
mc:
proto: tcp
addr: 25565
log: stdout
version: "2"

0 comments on commit 6c2e775

Please sign in to comment.