π Documentation builder #28
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: π Documentation builder | |
| concurrency: | |
| group: docs-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "30 04 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Create gather translations and publish the documentation | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| # Python | |
| pip install -r requirements.txt | |
| sudo apt-get install -y gettext | |
| # Go | |
| curl -OL https://github.com/transifex/cli/releases/download/v1.3.1/tx-linux-amd64.tar.gz | |
| tar -xvzf tx-linux-amd64.tar.gz | |
| - name: Pull then push translation strings | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| env: | |
| tx_token: ${{ secrets.TX_TOKEN }} | |
| run: | | |
| TX_TOKEN=$tx_token PROBE=$probe make transifex_pull | |
| TX_TOKEN=$tx_token PROBE=$probe make transifex_push | |
| - uses: stefanzweifel/git-auto-commit-action@v4 | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| with: | |
| commit_message: Update .tx/config | |
| - name: build | |
| run: | | |
| make html | |
| touch build/html/.nojekyll | |
| - name: Deploy π | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| uses: JamesIves/github-pages-deploy-action@4.1.4 | |
| with: | |
| branch: gh-pages | |
| folder: build/html |