Workflow file for this run
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
name: Deploy Snowpark UDFs and Stored Procs | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
workflow_dispatch: | |
env: | |
SNOWSQL_ACCOUNT: ${{ secrets.SNOWSQL_ACCOUNT }} | |
SNOWSQL_USER: ${{ secrets.SNOWSQL_USER }} | |
SNOWSQL_PWD: ${{ secrets.SNOWSQL_PWD }} | |
SNOWSQL_DATABASE: ${{ secrets.SNOWSQL_DATABASE }} | |
SNOWSQL_SCHEMA: ${{ secrets.SNOWSQL_SCHEMA }} | |
SNOWSQL_WAREHOUSE: ${{ secrets.SNOWSQL_WAREHOUSE }} | |
ARTIFACT_NAME: python-sources-${{ github.ref_name }}.zip | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Conda | |
uses: conda-incubator/[email protected] | |
with: | |
activate-environment: snowpark | |
environment-file: environment.yml | |
- name: Run tests | |
run: python -m pytest | |
- name: Create deployment artifact | |
run: zip -r ${{ env.ARTIFACT_NAME }} . -x .git/\* | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v2 | |
with: | |
name: python-sources-${{ github.ref_name }} | |
path: ${{ env.ARTIFACT_NAME }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v2 | |
with: | |
name: python-sources-${{ github.ref_name }} | |
- name: Install SnowSQL | |
run: | | |
curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.24-linux_x86_64.bash | |
SNOWSQL_DEST=~/snowflake SNOWSQL_LOGIN_SHELL=~/.profile bash snowsql-1.2.24-linux_x86_64.bash | |
- name: Deploy jobs | |
run: | | |
~/snowflake/snowsql \ | |
-f resources.sql \ | |
-o variable_substitution=true \ | |
--variable artifact_name=${{ env.ARTIFACT_NAME }} |