Asset check for prod @ ce6e0ad103c2a0987cf89473aca69c3a35c36aea #253
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: Post-deploy asset check | |
| run-name: Asset check for ${{ inputs.branch }} @ ${{ inputs.git_sha }} | |
| env: | |
| SLACK_CHANNEL_ID: CBX0KH5GA # #www-notify in MoCo Slack | |
| SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN_FOR_MEAO_NOTIFICATIONS_APP}} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: Branch of mozilla/bedrock that was deployed (eg. main|stage|prod) | |
| required: true | |
| git_sha: | |
| description: Git SHA that was deployed | |
| required: true | |
| origin_hostname: | |
| description: Fully qualified base URL for the origin server | |
| required: true | |
| cdn_hostname: | |
| description: Fully qualified base URL for the CDN (eg. https://www.mozilla.org) | |
| required: true | |
| jobs: | |
| notify-of-checks-start: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| sparse-checkout: | | |
| .github/actions/slack | |
| - name: Notify via Slack that tests are starting | |
| uses: ./.github/actions/slack | |
| with: | |
| channel_id: ${{ env.SLACK_CHANNEL_ID }} | |
| env_name: test | |
| label: "Static-assets check for [${{ inputs.git_sha }}]" | |
| message: "Static-assets check started" | |
| ref: ${{ inputs.branch }} | |
| slack_bot_token: ${{ env.SLACK_BOT_TOKEN }} | |
| status: info | |
| asset-check: | |
| runs-on: ubuntu-latest | |
| env: | |
| GIT_SHA: ${{ inputs.git_sha }} | |
| ORIGIN_HOSTNAME: ${{ inputs.origin_hostname }} | |
| CDN_HOSTNAME: ${{ inputs.cdn_hostname }} | |
| steps: | |
| - name: Pull release image | |
| run: docker pull mozmeao/bedrock:$GIT_SHA | |
| - name: Verify deployed assets are available | |
| run: | | |
| docker run --rm \ | |
| mozmeao/bedrock:$GIT_SHA \ | |
| python manage.py check_static_assets \ | |
| --origin-host "$ORIGIN_HOSTNAME" \ | |
| --cdn-host "$CDN_HOSTNAME" \ | |
| --manifest-path static/staticfiles.json | |
| notify-of-checks-completion: | |
| if: always() | |
| runs-on: ubuntu-latest | |
| needs: [asset-check] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| sparse-checkout: | | |
| .github/actions/slack | |
| - name: Notify via Slack of test-run success | |
| if: ${{ needs.asset-check.result == 'success' }} | |
| uses: ./.github/actions/slack | |
| with: | |
| channel_id: ${{ env.SLACK_CHANNEL_ID }} | |
| env_name: test | |
| label: "Static-assets checks for [${{ inputs.git_sha }}]" | |
| message: "Static-assets check completed. Status: success" | |
| ref: ${{ inputs.branch }} | |
| slack_bot_token: ${{ env.SLACK_BOT_TOKEN }} | |
| status: "success" | |
| - name: Notify via Slack of test-run failure | |
| if: ${{ needs.asset-check.result == 'failure' }} | |
| uses: ./.github/actions/slack | |
| with: | |
| channel_id: ${{ env.SLACK_CHANNEL_ID }} | |
| env_name: test | |
| label: "Static-assets checks for [${{ inputs.git_sha }}]" | |
| message: "Static-assets check completed. Status: failure" | |
| ref: ${{ inputs.branch }} | |
| slack_bot_token: ${{ env.SLACK_BOT_TOKEN }} | |
| status: "failure" | |
| - name: Notify via Slack of test-run cancelled | |
| if: ${{ needs.asset-check.result == 'cancelled' }} | |
| uses: ./.github/actions/slack | |
| with: | |
| env_name: test | |
| label: "Static-assets checks for [${{ inputs.git_sha }}]" | |
| status: "cancelled" | |
| channel_id: ${{ env.SLACK_CHANNEL_ID }} | |
| slack_bot_token: ${{ env.SLACK_BOT_TOKEN }} | |
| ref: ${{ inputs.branch }} | |
| message: "Static-assets check completed. Status: cancelled" |