Warm #46
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: Warm API | |
on: | |
push: | |
paths: [.github/workflows/warmer.yml] | |
schedule: | |
# ┌──────────────── minute (0 - 59) | |
# │ ┌────────────── hour (0 - 23) | |
# │ │ ┌──────────── day of the month (1 - 31) | |
# │ │ │ ┌──────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * | |
- cron: 0 0 */2 * * | |
jobs: | |
warm: | |
runs-on: ubuntu-latest | |
env: | |
REPOSITORY_NAME: ${{ github.event.repository.name }} | |
steps: | |
- name: cURL Swagger | |
run: | | |
[ ! "$(curl https://$GITHUB_REPOSITORY_OWNER-$REPOSITORY_NAME.hf.space/)" = "{\"detail\":\"Not Found\"}" ] | |
- name: cURL the API | |
run: | | |
[ "$(curl https://$GITHUB_REPOSITORY_OWNER-$REPOSITORY_NAME.hf.space/v1/)" = "\"Welcome to v1 of the API!"\" ] | |