name: deploy on: # schedule: # - cron: '*/10 * * * *' workflow_dispatch: branches: - master push: branches: - master concurrency: group: "scheduled" cancel-in-progress: true jobs: staging: name: Deploy to Staging runs-on: ubuntu-latest steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 with: python-version: '3.11' cache: 'pip' - run: pip install -r requirements.txt - run: dbt --debug run env: DBT_HOST: ${{ secrets.STAGING_HOST }} DBT_PORT: ${{ secrets.STAGING_PORT }} DBT_USER: ${{ secrets.STAGING_USER }} DBT_PASSWORD: ${{ secrets.STAGING_PASSWORD }} DBT_SECURE: ${{ secrets.STAGING_SECURE }} production: name: Deploy to Production needs: staging runs-on: ubuntu-latest steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 with: python-version: '3.11' cache: 'pip' - run: pip install -r requirements.txt - run: dbt --debug run env: DBT_HOST: ${{ secrets.PRODUCTION_HOST }} DBT_PORT: ${{ secrets.PRODUCTION_PORT }} DBT_USER: ${{ secrets.PRODUCTION_USER }} DBT_PASSWORD: ${{ secrets.PRODUCTION_PASSWORD }} DBT_SECURE: ${{ secrets.PRODUCTION_SECURE }} notify: name: Discord Notification runs-on: ubuntu-latest needs: - staging - production if: failure() || cancelled() steps: - name: Notify uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1 with: github-token: ${{ secrets.github_token }} discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}