fix(ci): remove env.target where not allowed (#1081) #279
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: Merge | |
on: | |
push: | |
branches: [main, demo] | |
paths-ignore: | |
- '*.md' | |
- '.github/**' | |
- '.github/graphics/**' | |
- '!.github/workflows/**' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Container tag; e.g. PR number or latest" | |
type: string | |
default: latest | |
target: | |
description: "Non-prod target; e.g. test or demo" | |
type: choice | |
options: ['test', 'demo'] | |
default: 'test' | |
concurrency: | |
# Do not interrupt previous workflows | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
jobs: | |
# Deploy to TEST or DEMO (both use TEST namespace) | |
deploys: | |
name: ${{ inputs.target == 'demo' && 'DEMO' || 'TEST' }} # Uppercase by convention | |
secrets: inherit | |
uses: ./.github/workflows/.deploy.yml | |
with: | |
environment: test | |
tag: ${{ inputs.tag }} # Uses PR number if blank | |
target: ${{ inputs.target || github.ref == github.event.repository.default_branch && 'test' || 'demo' }} | |
test: true | |
# Only deploy to PROD from the main (default) branch | |
deploy-prod: | |
name: PROD | |
if: github.ref == ${{ github.event.repository.default_branch }} | |
needs: [deploys] | |
secrets: inherit | |
uses: ./.github/workflows/.deploy.yml | |
with: | |
environment: prod | |
target: prod | |
test: false |