Deploy to Linux Server #32
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 Linux Server | |
| on: | |
| push: | |
| branches: ["*"] | |
| pull_request: | |
| branches: ["*"] | |
| schedule: | |
| - cron: '0 0 * * *' # Run at midnight (00:00 UTC) every day | |
| jobs: | |
| gtfs-check: | |
| name: GTFS feeds check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Check GTFS feeds | |
| run: python .github/scripts/check_gtfs_feeds.py | |
| realtime-check: | |
| name: Realtime feeds check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Check Realtime feeds | |
| run: python .github/scripts/check_realtime_feeds.py | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| needs: [gtfs-check, realtime-check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up SSH key | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Add server to known_hosts | |
| run: | | |
| ssh-keyscan 217.182.174.221 >> ~/.ssh/known_hosts | |
| - name: Copy files to server | |
| run: | | |
| rsync -avz --delete --exclude='.git*' ./ [email protected]:/var/www/html/hexatransit/datasets/data | |
| env: | |
| SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }} |