Skip to content

Update main.yml

Update main.yml #5

Workflow file for this run

name: Refresh Feed
on:
[push]
# schedule:
# - cron: 10 15 * * 0-6
permissions:
contents: write
jobs:
refresh-feed:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false
# - name: Fetch API Data 📦
# uses: JamesIves/fetch-api-data-action@v2
# with:
# endpoint: https://example.com
# configuration: '{ "method": "GET", "headers": {"Authorization": "Bearer ${{ secrets.API_TOKEN }}"} }'
# - name: Fetch API Data 📦
# uses: JamesIves/fetch-api-data-action@v2
# with:
# # The token endpoint is requested first. This retrieves the access token for the other endpoint.
# token-endpoint: https://uscms-openproject.k8s.accre.vanderbilt.edu/oauth/token
# # The configuration contains secrets held in the Settings/Secrets menu of the repository.
# token-configuration: '{ "method": "POST", "body": {"client_id": "${{ secrets.client_id }}", "client_secret": "${{ secrets.client_secret }}"} }'
# # Once the token endpoint has fetched then this endpoint is requested.
# # endpoint: https://example.com/data
# endpoint: 'http://uscms-openproject.k8s.accre.vanderbilt.edu/api/v3/work_packages?filters=[{"project": {"operator": "=", "values": ["4","5","35","6","8"]}}]&pageSize=1000'
# # The bearer token here is returned from the TOKEN_ENDPOINT call. The returned data looks like so: {data: {access_token: '123'}}, meaning it can be accessed using the triple bracket syntax.
# configuration: '{ "method": "GET", "headers": {"Authorization": "Bearer {{{ data.access_token }}}"} }'
- name: Fetch API Data
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: 'http://uscms-openproject.k8s.accre.vanderbilt.edu/api/v3/work_packages?filters=[{"project": {"operator": "=", "values": ["4","5","35","6","8"]}}]&pageSize=1000'
configuration: '{ "method": "GET", "headers": {"Authorization": "Basic ${{ secrets.openproj_id }}"} }'
- name: Build and Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: main # Pushes the updates to the main branch.
folder: fetch-api-data-action # The location of the data.json file saved by the Fetch API Data action.
target-folder: data # Saves the data into the 'data' directory on the main branch.