bluetoothlover_doc icon indicating copy to clipboard operation
bluetoothlover_doc copied to clipboard

github 在线调试

Open supperthomas opened this issue 1 year ago • 5 comments

  1. 在线调试

在使用 GitHub Actions 的过程中,如果需要登录到 Runner 上调试命令,那么下面这个技巧你一定会感兴趣。

  • uses: shaowenchen/debugger-action@v2 name: debugger timeout-minutes: 30 continue-on-error: true with: ngrok_token: ${{ secrets.NGROK_TOKEN }}

只需要去 Ngrok 官网申请一个 token,就可以通过 ssh 远程登录到 Runner。当然,也可以暴露 Runner 上的服务,提供外网访问的链接,最长可达 6 小时。

在执行日志中,我们可以找到 ssh 的登录链接,使用 root/root 即可登录 Runner。如果配置了 web 的端口映射,还可以查看到相关的服务链接。

supperthomas avatar Aug 29 '24 22:08 supperthomas

https://mp.weixin.qq.com/s/6SZx5uP3B_p8z5VVajsH7Q

supperthomas avatar Aug 29 '24 22:08 supperthomas

https://github.com/shaowenchen/debugger-action

supperthomas avatar Aug 29 '24 22:08 supperthomas

https://dashboard.ngrok.com/

supperthomas avatar Aug 29 '24 22:08 supperthomas

https://mp.weixin.qq.com/s/lPfJoL-C8P0rP_NfhP39AQ

supperthomas avatar Aug 29 '24 22:08 supperthomas

name: Ubuntu
on:
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Debug Session
        uses: csexton/debugger-action@master

supperthomas avatar Aug 30 '24 02:08 supperthomas