-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.76 KB
/
prod__append-last-trading-day.yaml
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
name: prod__append-last-trading-day
on:
schedule:
- cron: '0 4,7 * * 2-6' # Runs at 04:00 and 07:00 UTC on Tue, Wed, Thu, Fri, Sat
# Why not the rerun at 07:00 conditional on 04:00 pipeline failure? Since
# I have experienced that the API has response 200 OK but with incorrect data.
# This issue seems to occur (hopefully only) the first hour or so after US
# market closing hours. I guess Tiingo batch jobs for updating the data is running
# behind the scenes. Better API behavior in that case is either empty response
# {"content": "please wait until HH:MM UTC for available data"} or an HTTP 4xx
# error code with an explantory body. Risk of inaccurate data is the worst!
# So, I'll schedule a rerun of the exact same workflow some hours later, which should,
# hopefully improve reliability of ingest job both wrt. API connectivity and data quality.
workflow_dispatch:
jobs:
run-main-go:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23' # Specify the Go version you need
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('EtL/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: cd EtL && go mod download
- name: Run main.go
run: |
cd EtL
CGO_ENABLED=1 go run main.go eod daily
env:
TIINGO_TOKEN: ${{ secrets.TIINGO_TOKEN }}
MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }}
APP_ENV: ${{ vars.APP_ENV }}