Fix cron and deploy for bridge networking #41
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 infrastructure config | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy configs to server | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: root | |
| key: ${{ secrets.SERVER_SSH_KEY }} | |
| script: | | |
| cd /opt/akatsuki/hetzner-infra | |
| git fetch origin main | |
| git checkout origin/main | |
| # Apply config changes | |
| cp config/mysql/99-akatsuki.cnf /etc/mysql/mysql.conf.d/99-akatsuki.cnf | |
| # Ensure default mysqld.cnf doesn't override our bind-address | |
| sed -i 's/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf | |
| cp config/redis/redis.conf /etc/redis/redis.conf | |
| cp config/cron/akatsuki /etc/cron.d/akatsuki | |
| chmod 644 /etc/cron.d/akatsuki | |
| cp config/vault/config.hcl /opt/vault/config.hcl | |
| cp config/nginx/nginx.conf /etc/nginx/nginx.conf | |
| cp config/nginx/sites-enabled/*.conf /etc/nginx/sites-enabled/ | |
| # Validate and reload nginx | |
| nginx -t | |
| systemctl reload nginx | |
| # Apply firewall rules | |
| bash scripts/apply-firewall.sh | |
| # Restart data services only if their configs changed | |
| systemctl restart redis-server | |
| # MySQL and Vault require manual restart for safety |