Build and deploy #19900
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: Build and deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| # Run at 6 AM Eastern | |
| - cron: '0 11 * * *' | |
| # Run at noon Pacific | |
| - cron: '0 20 * * *' | |
| workflow_dispatch: null | |
| # Allows manual triggering of the workflow | |
| permissions: | |
| id-token: write # This is required for requesting the JWT | |
| contents: read # This is required for actions/checkout | |
| jobs: | |
| buildSite: | |
| env: | |
| GOPATH: ${{ github.workspace }}/go | |
| name: Install deps and build site | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Fetch secrets from ESC | |
| id: esc-secrets | |
| uses: pulumi/esc-action@v1 | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - uses: actions/setup-go@v2 | |
| with: | |
| go-version: 1.20.x | |
| - uses: peaceiris/actions-hugo@v2 | |
| with: | |
| hugo-version: '0.135.0' | |
| extended: true | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v2 | |
| with: | |
| role-to-assume: arn:aws:iam::388588623842:role/ContinuousDelivery | |
| role-session-name: docs-deploy | |
| role-duration-seconds: 7200 | |
| aws-region: us-west-2 | |
| - name: Install Pulumi CLI | |
| uses: pulumi/actions@v4 | |
| - name: Build and deploy | |
| run: make ci_push | |
| env: | |
| CDN_PULUMI_URN: ${{ vars.CDN_PULUMI_URN }} | |
| PULUMI_ACCESS_TOKEN: ${{ steps.esc-secrets.outputs.PULUMI_ACCESS_TOKEN }} | |
| PULUMI_STACK_NAME: ${{ vars.PULUMI_STACK_NAME }} | |
| DEPLOYMENT_ENVIRONMENT: ${{ vars.DEPLOYMENT_ENVIRONMENT }} | |
| SENTRY_AUTH_TOKEN: ${{ steps.esc-secrets.outputs.SENTRY_AUTH_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }} | |
| ALGOLIA_APP_SEARCH_KEY: ${{ vars.ALGOLIA_APP_SEARCH_KEY }} | |
| ALGOLIA_APP_ADMIN_KEY: ${{ steps.esc-secrets.outputs.ALGOLIA_APP_ADMIN_KEY }} | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| - name: Archive test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: browser-test-results | |
| path: cypress/videos | |
| - name: Archive bucket metadata | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: origin-bucket-metadata | |
| path: origin-bucket-metadata.json | |
| notify: | |
| if: (github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'pulumi-bot')) && failure() | |
| name: Send slack notification | |
| runs-on: ubuntu-latest | |
| needs: [buildSite] | |
| steps: | |
| - name: Fetch secrets from ESC | |
| id: esc-secrets | |
| uses: pulumi/esc-action@v1 | |
| - name: Slack Notification | |
| uses: docker://sholung/action-slack-notify:v2.3.0 | |
| env: | |
| SLACK_CHANNEL: docs-ops | |
| SLACK_COLOR: "#F54242" | |
| SLACK_MESSAGE: "build and deploy failure in pulumi/docs repo :meow_sad:" | |
| SLACK_USERNAME: docsbot | |
| SLACK_WEBHOOK: ${{ steps.esc-secrets.outputs.SLACK_WEBHOOK_URL }} | |
| SLACK_ICON: https://www.pulumi.com/logos/brand/avatar-on-white.png | |
| env: | |
| ESC_ACTION_OIDC_AUTH: true | |
| ESC_ACTION_OIDC_ORGANIZATION: pulumi | |
| ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization | |
| ESC_ACTION_ENVIRONMENT: github-secrets/pulumi-docs | |
| ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false |