feat: implement Content Security Policy and update dependencies #47
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 via SSH | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| configure_build: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run tests | |
| run: | | |
| python tests.py | |
| deploy: | |
| name: Deploy to SSH Server | |
| needs: configure_build | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Run deployment script | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: login.toolforge.org | |
| username: ${{ secrets.USERNAME }} | |
| key: ${{ secrets.KEY }} | |
| port: 22 | |
| request_pty: true | |
| script_stop: true | |
| script: | | |
| become translatetagger git -C '$HOME/www/python/src' fetch origin | |
| become translatetagger git -C '$HOME/www/python/src' reset --hard origin/main | |
| become translatetagger git -C '$HOME/www/python/src' pull origin main | |
| become translatetagger webservice python3.11 shell -- webservice-python-bootstrap | |
| become translatetagger webservice python3.11 restart | |
| become translatetagger webservice python3.11 status |