Update README.md #92
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: Trigger build for available dates in rix | |
| on: | |
| push: | |
| branches: [master, main] | |
| schedule: | |
| - cron: '0 14 * * 1' | |
| jobs: | |
| update-and-trigger-ubuntu: | |
| name: Trigger build for available dates on Ubuntu | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: rstats-on-nix | |
| authToken: "${{ secrets.CACHIX_AUTH }}" | |
| - name: Set branch_date as today | |
| id: set_date | |
| run: echo "branch_date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV | |
| - name: Check date | |
| run: echo ${{ env.branch_date }} | |
| - name: Update default.nix | |
| run: | | |
| sed -i 's/REPLACE_DATE/${{ env.branch_date }}/g' default.nix | |
| - name: Build on date ${{ github.event.client_payload.ref_name }} | |
| run: | | |
| nix-build --max-jobs 1 --cores 2 default.nix | |
| update-and-trigger-macos: | |
| name: Trigger build for available dates on macOS | |
| runs-on: macos-latest | |
| needs: update-and-trigger-ubuntu | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: rstats-on-nix | |
| authToken: "${{ secrets.CACHIX_AUTH }}" | |
| - name: Set branch_date as today | |
| id: set_date | |
| run: echo "branch_date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV | |
| - name: Check date | |
| run: echo ${{ env.branch_date }} | |
| - name: Update default.nix | |
| run: | | |
| sed -i '' 's/REPLACE_DATE/${{ env.branch_date }}/g' default.nix | |
| - name: Build on date ${{ github.event.client_payload.ref_name }} | |
| run: | | |
| nix-build --max-jobs 1 --cores 2 default.nix | |
| clone-and-open-pr: | |
| name: Clone rix and open PR | |
| runs-on: ubuntu-latest | |
| needs: update-and-trigger-macos | |
| steps: | |
| - name: Clone rix and open PR | |
| run: | | |
| curl -X POST \ | |
| -H "Authorization: token ${{ secrets.UPDATE_AVAILABLE_DATES }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| https://api.github.com/repos/ropensci/rix/dispatches \ | |
| -d '{ | |
| "event_type": "trigger-workflow" | |
| }' | |