Build This Sh11111 #21
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: Build This Sh11111 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'jars/**' | |
| - 'site/**' | |
| - 'generate_data.py' | |
| - 'download_jars.py' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install requests | |
| run: pip install requests | |
| - name: Generate assets | |
| run: python .root/generate_site_assets.py | |
| - name: Download releases | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python download_jars.py | |
| ls -R | |
| python generate_data.py | |
| ls -R | |
| - name: Deploy (into "repo") | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| mv maven-repo ../maven-repo-temp | |
| mv site ../site-temp | |
| if git ls-remote --heads origin repo | grep -q repo; then | |
| git fetch origin repo | |
| git checkout -f repo | |
| else | |
| git checkout --orphan repo | |
| fi | |
| git rm -rf . 2>/dev/null || true | |
| cp -r ../maven-repo-temp/* . | |
| cp -r ../site-temp/. . | |
| touch .nojekyll | |
| rm -rf ../maven-repo-temp ../site-temp | |
| git add . | |
| git commit -m "Deploy by $(date)" | |
| git push origin repo --force |