From 3de2a3bd6a371b8d47f23fdba43b399895cd8d36 Mon Sep 17 00:00:00 2001 From: Vignesh Desmond Date: Thu, 22 Apr 2021 16:01:02 +0530 Subject: [PATCH] testing custom badge testing failed badge testing failed badge 2 final changes --- .github/workflows/schedule.yml | 28 ++++++++++++++++++++++++++-- .github/workflows/test.yml | 5 +++-- README.md | 2 +- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 2096ce0..e0e7d3e 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -2,16 +2,40 @@ name: Scheduled Heroku test on: schedule: - - cron: "0 3 * * *" + - cron: "0 0 * * *" jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Check status of API + id: api-status uses: lakuapik/gh-actions-http-status@v1 with: sites: '["yomomma-api.herokuapp.com/","yomomma-api.herokuapp.com/jokes","yomomma-api.herokuapp.com/search?query=doctor"]' expected: '[200,200,200]' + continue-on-error: true + + - name: Update badges on success + uses: RubbaBoy/BYOB@v1.2.0 + if: steps.api-status.outcome == 'success' + with: + NAME: heroku + LABEL: 'API Status' + ICON: 'https://simpleicons.vercel.app/heroku/c9c3e6' + STATUS: 'Deployed' + COLOR: purple + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update badges on fail + uses: RubbaBoy/BYOB@v1.2.0 + if: steps.api-status.outcome != 'success' + with: + NAME: heroku + LABEL: 'API Status' + ICON: 'https://simpleicons.vercel.app/heroku/c9c3e6' + STATUS: 'Down' + COLOR: red + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23d8bd4..650e510 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,5 +39,6 @@ jobs: pip3 install -r requirements.txt if: steps.cache-venv.outputs.cache-hit != 'true' - - name: Activate venv and Run Test - run: . venv/bin/activate && pytest app/test.py + - name: Activate venv and Run Test + id: api-test + run: . venv/bin/activate && pytest app/test.py \ No newline at end of file diff --git a/README.md b/README.md index a8ac97b..3be4e5a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # yomomma-apiv2 [![example workflow](https://github.com/beanboi7/yomomma-apiv2/actions/workflows/test.yml/badge.svg)](https://github.com/beanboi7/yomomma-apiv2/actions/workflows/test.yml) -[![Heroku](https://github.com/beanboi7/yomomma-apiv2/actions/workflows/schedule.yml/badge.svg)](https://yomomma-api.herokuapp.com/jokes/) +[![Heroku](https://byob.yarr.is/beanboi7/yomomma-apiv2/heroku/)](https://yomomma-api.herokuapp.com/jokes/) **An API that insults yo momma**