Update structure #50
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: ["*"] | |
| jobs: | |
| syntax-check: | |
| name: Syntax check (CSV & JSON) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Check trafic.json syntax | |
| run: | | |
| python -m json.tool trafic.json | |
| - name: Check lines_picto.csv syntax | |
| run: | | |
| python -c "import csv; f=open('lines_picto.csv', encoding='utf-8'); next(csv.reader(f, delimiter=';')); f.seek(0); [row for row in csv.reader(f, delimiter=';')]" | |
| - name: Check logo paths existence | |
| run: python .github/scripts/check_logo_path_existence.py | |
| gtfs-check: | |
| name: GTFS routes check | |
| runs-on: ubuntu-latest | |
| needs: syntax-check | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Check GTFS routes match trafic.json | |
| run: python .github/scripts/check_gtfs_route_trafic.py | |
| - name: Check GTFS routes match lines_picto | |
| run: python .github/scripts/check_gtfs_route_lines_picto.py | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| needs: [syntax-check, gtfs-check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up SSH key | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| 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*' ./ jouca@217.182.174.221:/var/www/html/hexatransit | |
| env: | |
| SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }} |