-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dee748e
commit 0145775
Showing
1 changed file
with
8 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,22 @@ jobs: | |
|
||
env: | ||
REPO_NAME: "quickstart_common.public.quickstart_repo" | ||
SNOWFLAKE_CONNECTIONS_DEFAULT_AUTHENTICATOR: "SNOWFLAKE_JWT" | ||
SNOWFLAKE_CONNECTIONS_DEFAULT_PRIVATE_KEY_FILE: ".snowflake/snowflake_rsa_key" | ||
# Read connection secrets | ||
SNOWFLAKE_CONNECTIONS_DEFAULT_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | ||
SNOWFLAKE_CONNECTIONS_DEFAULT_USER: ${{ secrets.SNOWFLAKE_USER }} | ||
SNOWFLAKE_CONNECTIONS_DEFAULT_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} | ||
|
||
steps: | ||
# Checkout step is necessary if you want to use a config file from your repo | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Write private key secret as file | ||
- name: Configure Private Key | ||
run: | | ||
echo "${{ secrets.SNOWFLAKE_PRIVATE_KEY }}" > .snowflake/snowflake_rsa_key | ||
# Install Snowflake CLI GitHub Action and point to config file | ||
- name: Install snowflake-cli | ||
uses: Snowflake-Labs/[email protected] | ||
|
@@ -35,18 +41,4 @@ jobs: | |
|
||
# Update Snowflake's copy of the repository | ||
- name: Fetch repository changes | ||
run: snow git fetch "${REPO_NAME}" | ||
|
||
# Deploy pipeline with branch specific parameters | ||
- name: Deploy data pipeline to ${{ github.ref_name }} | ||
run: | | ||
BRANCH_NAME=${{ github.ref_name }} | ||
if [ "${BRANCH_NAME}" == "main" ]; then | ||
RETENTION_TIME=1 | ||
else | ||
RETENTION_TIME=0 | ||
fi | ||
snow git execute \ | ||
"@${REPO_NAME}/branches/${BRANCH_NAME}/steps/0[134]_*" \ | ||
-D "environment='${BRANCH_NAME}'" \ | ||
-D "retention_time=${RETENTION_TIME}" | ||
run: snow connection test |