Localisation updates from https://translatewiki.net. #161
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: Toolforge Deploy | |
| on: | |
| workflow_dispatch: ~ | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "uwsgi.ini" | |
| - "src/**" | |
| - "translations/**" | |
| - ".github/workflows/toolforge-deploy.yml" | |
| jobs: | |
| deploy: | |
| name: Deploy to Toolforge | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install GNU gettext tools | |
| run: | | |
| echo "When Toolforge's python image will have gettext?" | |
| sudo apt-get update && sudo apt-get install -y gettext | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: 3.11 | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r src/requirements.txt | |
| - name: Compile translations | |
| run: | | |
| cd src | |
| python manage.py translate | |
| - name: Configure SSH key | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
| - name: Copy translations to Toolforge project folder | |
| run: | | |
| scp -r src/locale ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/data/project/qs-dev/locale | |
| - name: Run deployment commands | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| request_pty: true | |
| script: | | |
| set -xe | |
| become qs-dev git -C ./www/python fetch origin | |
| become qs-dev git -C ./www/python reset --hard origin/main | |
| become qs-dev git -C ./www/python pull origin main | |
| become qs-dev take ./locale | |
| become qs-dev rm -rf ./www/python/src/locale | |
| become qs-dev mv ./locale ./www/python/src/locale | |
| become qs-dev kubectl delete pods -n tool-qs-dev -l app.kubernetes.io/component=webservice-interactive | |
| become qs-dev webservice --mem 512Mi python3.11 shell -- webservice-python-bootstrap | |
| become qs-dev webservice --mem 512Mi python3.11 shell -- ./www/python/venv/bin/python ./www/python/src/manage.py migrate | |
| become qs-dev webservice --mem 512Mi python3.11 shell -- ./www/python/venv/bin/python ./www/python/src/manage.py collectstatic --noinput | |
| become qs-dev webservice python3.11 restart --mem 4Gi | |
| become qs-dev webservice python3.11 status | |