-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.99 KB
/
publisher-deforestation-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Publisher Job (deforestation)
on:
schedule:
- cron: '30 11 * * *'
- cron: '30 17 * * *'
- cron: '30 23 * * *'
- cron: '0 3 * * *'
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: 'deforestation'
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: deforestation
- 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 }}