Skip to content

Deploy to Production #8

Deploy to Production

Deploy to Production #8

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 }}
SUDO_PASSWORD: ${{ secrets.GIT_USER_PASSWORD }}
run: |
sudo tailscale ssh git@$SERVER_IP << 'EOF'
cd /var/www/
bash deploy-code/deploy-update.sh branch origin/main
EOF