Rename SQL scripts #10
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
# Very basic GitHub Action workflow, goes in ~/.github/workflows/deploy.yaml | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on any branch or tag commit | |
push: | |
paths: | |
- 'admin/*' | |
branches: | |
- "main" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# This workflow contains a single job called "deploy" | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
SNOWSQL_PWD: ${{ secrets.SNOWSQL_PWD }} | |
SNOWSQL_ACCOUNT: ${{ secrets.SNOWSQL_ACCOUNT }} | |
SNOWSQL_USER: ${{ secrets.SNOWSQL_USER }} | |
# SNOWSQL_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }} | |
# SNOWSQL_SCHEMA: ${{ secrets.SNOWFLAKE_SCHEMA }} | |
# SNOWSQL_ROLE: ${{ secrets.SNOWFLAKE_ROLE }} | |
SNOWSQL_WAREHOUSE: ${{ secrets.SNOWSQL_WAREHOUSE }} | |
saml2_x509_cert: ${{ secrets.SAML2_X509_CERT }} | |
saml2_sso_url: ${{ secrets.SAML2_SSO_URL }} | |
saml2_issuer: ${{ secrets.SAML2_ISSUER }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Install SnowSQL | |
run: | | |
curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.9-linux_x86_64.bash | |
SNOWSQL_DEST=~/bin SNOWSQL_LOGIN_SHELL=~/.profile bash snowsql-1.2.9-linux_x86_64.bash | |
- name: Create warehouses | |
run: | | |
~/bin/snowsql -f admin/warehouses.sql | |
- name: Create databases | |
run: | | |
~/bin/snowsql -f admin/databases.sql | |
- name: Create tableau oauth | |
run: | | |
~/bin/snowsql -f admin/oauth.sql | |
- name: Create users | |
run: | | |
~/bin/snowsql -f admin/users.sql --variable saml2_issuer=$saml2_issuer --variable saml2_sso_url=$saml2_sso_url --variable saml2_x509_cert=$saml2_x509_cert | |
- name: Roles and granting policies | |
run: | | |
~/bin/snowsql -f admin/roles.sql | |
- name: Governance | |
run: | | |
~/bin/snowsql -f admin/policies.sql |