CI #45
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: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: '24' | |
| - uses: pnpm/action-setup@v4 | |
| - name: Get secrets | |
| run: | | |
| cd config | |
| mkdir secrets | |
| echo "${{ secrets.crowdin_key }}" > secrets/crowdin_key.txt | |
| - name: esbuild | |
| run: | | |
| pnpm i | |
| pnpm run ci-build | |
| # Remove gitignore rule for public folder | |
| sed -i 's/public\///' .gitignore | |
| - name: Start server | |
| run: | | |
| cd public | |
| pnpx http-server --port 8080 & | |
| - name: Install dependencies | |
| run: | | |
| cd unit_tests | |
| # sudo apt-get install xvfb firefox | |
| python3 -m pip install -r requirements.txt | |
| - name: Gecko setup | |
| run: | | |
| wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz | |
| sudo sh -c 'tar -x geckodriver -zf geckodriver-v0.24.0-linux64.tar.gz -O > /usr/bin/geckodriver' | |
| sudo chmod +x /usr/bin/geckodriver | |
| rm geckodriver-v0.24.0-linux64.tar.gz | |
| export PATH=$PATH:/usr/bin/geckodriver | |
| - name: Test with pytest | |
| run: | | |
| cd unit_tests | |
| python3 -m pytest -s | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public | |
| cname: cloverleaf.app | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' |