This project uses GitHub Actions to automate the deployment of SQL scripts to different environments in Snowflake:
- DEV: Runs scripts in the
DEVschema on every push to any branch (exceptmain). - QA: Runs scripts in the
QAschema only after a successful deploy to DEV. - PRD: Runs scripts in the production schema (defined by the
SCHEMA_PRDvariable) after merging into themainbranch.
- Create a development branch.
- Add or modify
.sqlfiles and commit/push your changes. - The pipeline will automatically execute:
- First in DEV.
- If DEV succeeds, then in QA.
- After review, merge into
mainto trigger deployment to PRD.
The following secrets must be configured in your repository settings:
SNOWSQL_ACCOUNTSNOWSQL_USERSNOWSQL_PWD
You can manually trigger the pipeline from the "Actions" tab in GitHub.
- Add or modify
.sqlfiles in your repository. - On commit and push, the pipeline will detect and execute only the changed
.sqlfiles.
git checkout -b feature/my-new-view
# Edit or add your .sql files
git add sql/views/my_new_view.sql
git commit -m "feat: add my new view script"
git push origin feature/my-new-viewOpen a Pull Request to main when ready for production deployment.
Note:
- The pipeline ensures QA only runs after a successful DEV deploy.
- Production deploys only occur after merging into
main. - All jobs require the Snowflake secrets to be set in the repository.