Deploy main to Frontend nonprod #390
This file contains 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: Deploy Frontend | |
run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }} | |
on: | |
push: | |
branches: | |
- "main" | |
paths: | |
- "frontend/**" | |
- "infra/frontend/**" | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: "target environment" | |
required: true | |
default: "dev" | |
type: choice | |
options: | |
- dev | |
- staging | |
- prod | |
version: | |
required: true | |
default: "main" | |
description: Tag or branch or SHA to deploy | |
jobs: | |
frontend-checks: | |
name: Run Frontend Checks | |
uses: ./.github/workflows/ci-frontend.yml | |
vulnerability-scans: | |
name: Vulnerability Scans | |
uses: ./.github/workflows/vulnerability-scans.yml | |
with: | |
app_name: frontend | |
deploy: | |
name: Deploy | |
needs: [frontend-checks, vulnerability-scans] | |
uses: ./.github/workflows/deploy.yml | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
envs: ${{ fromJSON(inputs.environment != null && format('["{0}"]', inputs.environment) || github.event_name == 'release' && '["prod"]' || github.ref_name == 'main' && '["dev", "staging"]' || '["dev"]') }} | |
with: | |
app_name: "frontend" | |
environment: ${{ matrix.envs }} | |
version: ${{ inputs.version || github.ref }} | |
send-slack-notification: | |
if: failure() | |
needs: [frontend-checks, vulnerability-scans, deploy] | |
uses: ./.github/workflows/send-slack-notification.yml | |
secrets: inherit |