name: deploy docs on: workflow_dispatch: branches: - master push: jobs: staging: name: Deploy to Staging Cloudflare Pages runs-on: ubuntu-latest permissions: contents: read deployments: write 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 docs generate 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 }} - run: ./docs.sh - name: Publish uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1.5.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: ethpandaops-platform-staging-dbt directory: target gitHubToken: ${{ secrets.GITHUB_TOKEN }} production: name: Deploy to Production Cloudflare Pages needs: staging runs-on: ubuntu-latest permissions: contents: read deployments: write 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 docs generate 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 }} - run: ./docs.sh - name: Publish uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1.5.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: ethpandaops-platform-production-dbt directory: target gitHubToken: ${{ secrets.GITHUB_TOKEN }} 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 }}