Retrieve and commit Sonatype stats #17
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/scala-cli-setup@v1.0.4 | |
- 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 'scala-center-bot@users.noreply.github.com' | |
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: scala-center-bot@users.noreply.github.com |