chore: trigger pipeline #28
This file contains hidden or 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
| name: Deploy East | |
| on: | |
| schedule: | |
| - cron: '*/5 * * * *' | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| env: | |
| MACHINE: hey-xyz | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Connect to Tailscale | |
| uses: tailscale/github-action@v4 | |
| with: | |
| oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
| oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
| tags: tag:ci | |
| hostname: deploy-east-hey-xyz-${{ github.run_id }} | |
| ping: ${{ env.MACHINE }} | |
| version: latest | |
| - name: Add SSH key | |
| env: | |
| SSH_KEY: ${{ secrets.SSH_KEY }} | |
| SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
| run: | | |
| mkdir -p ~/.ssh | |
| MACHINE_IP="$(tailscale ip -4 $MACHINE)" | |
| ssh-keyscan $MACHINE_IP >> ~/.ssh/known_hosts | |
| echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/key | |
| chmod 600 ~/.ssh/key | |
| ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
| ssh-add ~/.ssh/key | |
| - name: Deploy | |
| run: | | |
| MACHINE_IP="$(tailscale ip -4 $MACHINE)" | |
| USERHOST="root@$MACHINE_IP" | |
| COMMAND="tailscale ping --c 5 --until-direct=false --size 65467 pi" | |
| ssh $USERHOST "$COMMAND" |