Deploy to Production #10
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 to Production | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Tailscale | |
run: | | |
sudo curl -fsSL https://tailscale.com/install.sh | sh | |
- name: Authenticate with Tailscale | |
env: | |
TAILSCALE_AUTH_KEY: ${{ secrets.TAILSCALE_AUTH_KEY }} | |
run: | | |
sudo tailscale up --authkey=$TAILSCALE_AUTH_KEY | |
- name: Deploy via Tailscale SSH | |
env: | |
SERVER_IP: ${{ secrets.SERVER_TAILSCALE_IP }} | |
run: | | |
sudo tailscale ssh git@$SERVER_IP << 'EOF' | |
cd /var/www/ | |
bash deploy-code/deploy-update.sh branch origin/main | |
EOF |