Retrieve and commit Sonatype stats #22
This file contains 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: Retrieve and commit Sonatype stats | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 15 * *' | |
jobs: | |
update_data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: coursier/cache-action@v6 | |
- uses: VirtusLab/[email protected] | |
- uses: actions/checkout@v4 | |
- name: Checkout the gh-pages branch while keeping the scripts | |
run: | | |
git fetch origin gh-pages --depth 1 | |
git checkout origin/gh-pages | |
git restore --source=${{ github.sha }} --worktree .github/scripts | |
- name: Update stats | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
run: .github/scripts/update.sc | |
- name: Push changes | |
run: | | |
git config --global user.name 'Scala Center Bot' | |
git config --global user.email '[email protected]' | |
git add sonatype-stats | |
git commit -m "Update stats" | |
git push origin HEAD:gh-pages | |
- uses: gautamkrishnar/keepalive-workflow@v1 | |
with: | |
committer_username: scala-center-bot | |
committer_email: [email protected] |