Skip to content

Quotes API Call Auto-Update #93

Quotes API Call Auto-Update

Quotes API Call Auto-Update #93

Workflow file for this run

name: Quotes API Call Auto-Update
# Controls when the action will run. Triggers the workflow on the first of every month
on:
workflow_dispatch:
schedule:
- cron: "0 10 1,15 * *" # cron schedule - twice a month, on the 1st and 15th at 10am.
# Action: Fetch API Data - saves data to fetch_api_data env variable and json file located in 'data/data.json'
jobs:
refresh-feed:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false
- name: Install SSH Client
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.API_QUOTE }}
- name: Fetch API Data
uses: JamesIves/fetch-api-data-action@releases/v1
with:
ENDPOINT: https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&type=single
SAVE_NAME: quotes # name of the json file that contains the quote pulled from the API.
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
SSH: true
BRANCH: main # Pushes the updates to branch called main.
FOLDER: fetch-api-data-action # folder that this action will be deploying
TARGET_FOLDER: _data # folder where the committed data will ultimately reside
COMMIT_MESSAGE: "New Quote Text"