Skip to content

Commit

Permalink
Fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kaarthik108 committed Sep 23, 2023
1 parent 4b1aeca commit ffba033
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/snowflake_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Deploy to Snowflake

# This workflow is triggered on pushes to the prod branch and when there are changes in the src directory.
on:
push:
branches:
Expand Down Expand Up @@ -39,24 +38,30 @@ jobs:
run: |
poetry install
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37

- name: Deploy to Snowflake
run: |
cd src
for dir in */; do
component_type=${dir%/}
case $component_type in
task)
poetry run snowdev deploy --task $dir || continue
;;
streamlit)
poetry run snowdev deploy --streamlit $dir || continue
;;
udf)
poetry run snowdev deploy --udf $dir || continue
;;
sproc)
poetry run snowdev deploy --sproc $dir || continue
;;
esac
IFS=$'\n'
for file in ${{ steps.changed-files.outputs.all_modified_files }}; do
dir=$(dirname $file)
component_type=$(basename $dir)
case $component_type in
task)
poetry run snowdev deploy --task $dir || continue
;;
streamlit)
poetry run snowdev deploy --streamlit $dir || continue
;;
udf)
poetry run snowdev deploy --udf $dir || continue
;;
sproc)
poetry run snowdev deploy --sproc $dir || continue
;;
esac
done
continue-on-error: true
2 changes: 1 addition & 1 deletion src/udf/test_new_/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def fetch_customer_data(session: Session):
return customer_data.to_pandas()

session = get_snowflake_session()
df_customer = fetch_customer_data(session)
df_customer = fetch_customer_data(session)

0 comments on commit ffba033

Please sign in to comment.