-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (38 loc) · 1.32 KB
/
upload_to_snowflake.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
name: Upload to Snowflake
on:
schedule:
- cron: '0 10 * * *' # This schedule runs the workflow every day at 10:00AM UTC
workflow_dispatch:
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Snowflake Connector
run: |
pip install snowflake-connector-python pandas
- name: Upload to Snowflake
run: python .github/scripts/upload_to_snowflake.py
env:
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_STAGE: ${{ secrets.SNOWFLAKE_STAGE }}
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
SNOWFLAKE_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }}
SNOWFLAKE_SCHEMA: ${{ secrets.SNOWFLAKE_SCHEMA }}
SNOWFLAKE_ROLE: ${{ secrets.SNOWFLAKE_ROLE }}
rerun-failed-jobs:
runs-on: ubuntu-latest
needs: upload
if: failure()
steps:
- name: Rerun failed jobs in the current workflow
env:
GH_TOKEN: ${{ github.token }}
run: gh run rerun ${{ github.run_id }} --failed