tailscale / github-action

A GitHub Action to connect your workflow to your Tailscale network.
BSD 3-Clause "New" or "Revised" License
519 stars 78 forks source link

tailscale github-action scp/ssh issues #81

Closed Auggie321 closed 10 months ago

Auggie321 commented 10 months ago

hi folks,

Does there have some solutions in tailscale/github-action copying local file to remote tailscale node ?

***
    steps:
      - uses: actions/checkout@v3

      - name: Build Image
        run: |
          cd build
          source variables.env
          docker build -t ${BUILD_NAME} .
          docker save ${BUILD_NAME}|gzip > demoimage$(date "+%Y%m%d-%H%M%S").tgz

      - name: add ssh key
      ***

      - name: Setup Tailscale
        uses: tailscale/github-action@v2
        with:
          oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
          oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
          tags: tag:ci

      - name: ship it
        run: |
          tailscale ip -4 $MACHINE
          echo ${{ secrets.SSH_USERNAME_ROOT }}@${{ secrets.SSH_HOST }}:/tmp
          scp -i ~/.ssh/key build/*.tgz ${{ secrets.SSH_USERNAME_ROOT }}@${{ secrets.SSH_HOST }}:/tmp
***

if use this configuration, tailscale/github-action inner environment can't recognized remote tailscale node ip network. and will got bellow error:

100.68.105.66
***@***:/tmp
ssh: connect to host *** port 22: Connection timed out
lost connection
Error: Process completed with exit code 1.

i knew deploy new tailscale node need to get permission to authenticate firstly. not sure how to set in tailscale/github-action. Am I missing something here ? To add to that, tag:ci is already configured in tailscale admin console acl and target tailscale node. thanks

Auggie321 commented 10 months ago

Reading some of tailscale's blogs, I realized that this content is no longer available.
the GitHub ssh/scp-action transfer rate itself is actually quite poor,
and borrowing this method to transfer large docker images or files is probably not a good idea.
I've switched to a different method instead, such as the one in the title. Hopefully, tailscale will be able to follow up with this solution.