add action #1
Workflow file for this run
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
on: | |
schedule: | |
- cron: "0 12 * * *" # Once per day | |
push: | |
jobs: | |
archive: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
curl --fail https://stats.filspark.com/participants/top-measurements?from=yesterday&to=yesterday > top-measurements.json | |
- uses: softprops/action-gh-release@v2 | |
with: | |
files: top-measurements.json | |
- if: failure() | |
uses: slackapi/[email protected] | |
with: | |
channel-id: alerts | |
payload: | | |
{ | |
"text": "Top measurements archival failed", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":warning: *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Top measurements archival failed>*" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |