Publisher Job (climate) #806
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: Publisher Job (climate) | |
on: | |
schedule: | |
- cron: '0 11 * * *' | |
- cron: '0 17 * * *' | |
- cron: '0 23 * * *' | |
- cron: '0 2 * * *' | |
workflow_dispatch: | |
inputs: | |
publishForced: | |
description: 'Flag to force publisher regardless the configuration' | |
type: boolean | |
default: true | |
required: true | |
category: | |
description: 'News Category to filter out' | |
type: string | |
required: true | |
default: 'climate' | |
environment: | |
description: 'Environment to run tests against' | |
type: environment | |
required: false | |
jobs: | |
job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish new articles (schedule) | |
run: | | |
CODE=`curl --write-out '%{http_code}' \ | |
--silent \ | |
--output /dev/null \ | |
--request GET \ | |
--header 'Authorization: Bearer ${{ secrets.CLIMATELINE_JOB_SECRET }}' \ | |
--header 'content-type: application/json' \ | |
--url "https://climateline-processor.vercel.app/api/publisher-job?category=$CATEGORY&publish_forced=$PUBLISH_FORCED"` | |
if [ $CODE != "200" ]; then | |
exit 1 | |
fi | |
if: ${{ github.event_name == 'schedule' }} | |
env: | |
PUBLISH_FORCED: true | |
CATEGORY: climate | |
- name: Publish new articles (dispatch) | |
run: | | |
CODE=`curl --write-out '%{http_code}' \ | |
--silent \ | |
--output /dev/null \ | |
--request GET \ | |
--header 'Authorization: Bearer ${{ secrets.CLIMATELINE_JOB_SECRET }}' \ | |
--header 'content-type: application/json' \ | |
--url "https://climateline-processor.vercel.app/api/publisher-job?category=$CATEGORY&publish_forced=$PUBLISH_FORCED"` | |
if [ $CODE != "200" ]; then | |
exit 1 | |
fi | |
if: ${{ github.event_name != 'schedule' }} | |
env: | |
PUBLISH_FORCED: ${{ inputs.publishForced }} | |
CATEGORY: ${{ inputs.category }} |