chore(ora): simplify build_modules.js, add linting + libs forward-compat, wire publish workflow [sc-550202] #1163
This file contains hidden or 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: Snowflake dedicated env | |
| on: | |
| pull_request: | |
| types: [closed, unlabeled, labeled, synchronize] | |
| env: | |
| NODE_VERSION: 20.19 | |
| jobs: | |
| dedicated: | |
| if: | | |
| github.event.label.name == 'dedicated_snowflake' || | |
| (github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'dedicated_snowflake')) || | |
| (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'dedicated_snowflake')) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| env: | |
| SF_ACCOUNT: ${{ secrets.SF_ACCOUNT_CD }} | |
| SF_DATABASE: ${{ secrets.SF_DATABASE_CD }} | |
| SF_USER: ${{ secrets.SF_USER_CD }} | |
| SF_PASSWORD: ${{ secrets.SF_PASSWORD_CD }} | |
| SF_ROLE: ${{ secrets.SF_ROLE_CD }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| - name: Set SF_PREFIX for releases | |
| if: startsWith(github.event.pull_request.head.ref, 'release/') | |
| run: | | |
| echo "SF_PREFIX=dedicated_release_${{ github.event.pull_request.number }}_" >> $GITHUB_ENV | |
| - name: Set SF_PREFIX for hotfixes | |
| if: startsWith(github.event.pull_request.head.ref, 'hotfix/') | |
| run: | | |
| echo "SF_PREFIX=dedicated_hotfix_${{ github.event.pull_request.number }}_" >> $GITHUB_ENV | |
| - name: Set SF_PREFIX for regular deploys | |
| if: | | |
| !(startsWith(github.event.pull_request.head.ref, 'hotfix/')) && | |
| !(startsWith(github.event.pull_request.head.ref, 'release/')) | |
| run: echo "SF_PREFIX=dedicated_${{ github.event.pull_request.number }}_" >> $GITHUB_ENV | |
| - name: Setup node | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Run deploy | |
| id: deploy | |
| if: github.event.action == 'synchronize' || github.event.action == 'labeled' | |
| run: | | |
| cd clouds/snowflake | |
| make deploy | |
| - name: Run remove | |
| id: remove | |
| if: github.event.action == 'unlabeled' || github.event.action == 'closed' | |
| run: | | |
| cd clouds/snowflake | |
| make remove | |
| - name: Comment deploy PR | |
| if: steps.deploy.outcome == 'success' && github.event.action == 'labeled' | |
| uses: thollander/actions-comment-pull-request@v1 | |
| with: | |
| message: | | |
| Dedicated ${{ env.SF_PREFIX }}carto environment deployed in Snowflake database ${{ env.SF_ACCOUNT }}.${{ env.SF_PROJECT }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Comment remove PR | |
| if: steps.remove.outcome == 'success' && (github.event.action == 'unlabeled' || github.event.action == 'closed') | |
| uses: thollander/actions-comment-pull-request@v1 | |
| with: | |
| message: | | |
| Dedicated environment removed | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |