Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous Deployment to preview after successful end 2 end tests #1199

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
31 changes: 24 additions & 7 deletions .github/workflows/Deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Deploy
run-name: "Deploy from [${{ github.ref_name }}] to [${{ inputs.branch }}]"

on:
workflow_run:
workflows: [ "End to end tests" ]
types: [ completed ]
branches: [ main ]
workflow_dispatch:
inputs:
branch:
Expand Down Expand Up @@ -34,9 +38,13 @@ on:
default: 'latest'

permissions:
contents: read
contents: write
actions: read

concurrency:
group: 'deploy'
cancel-in-progress: true

defaults:
run:
shell: pwsh
Expand All @@ -55,12 +63,21 @@ jobs:
- name: Create inputs
id: CreateInputs
run: |
$branch = '${{ github.event.inputs.branch }}'
$copyToMain = '${{ github.event.inputs.copyToMain }}'
$directCommit = '${{ github.event.inputs.directCommit }}'
$requireEndToEndTests = '${{ github.event.inputs.requireEndToEndTests }}'
$createRelease = '${{ github.event.inputs.createRelease }}'
$defaultBcContainerHelperVersion = '${{ github.event.inputs.defaultBcContainerHelperVersion }}'
if ($env:GITHUB_EVENT_NAME -eq 'workflow_run') {
$branch = 'preview'
$copyToMain = 'false'
$directCommit = 'false'
$requireEndToEndTests = 'true'
$createRelease = 'false'
$defaultBcContainerHelperVersion = 'preview'
} else {
$branch = '${{ github.event.inputs.branch }}'
$copyToMain = '${{ github.event.inputs.copyToMain }}'
$directCommit = '${{ github.event.inputs.directCommit }}'
$requireEndToEndTests = '${{ github.event.inputs.requireEndToEndTests }}'
$createRelease = '${{ github.event.inputs.createRelease }}'
$defaultBcContainerHelperVersion = '${{ github.event.inputs.defaultBcContainerHelperVersion }}'
}
Add-Content -encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "branch=$branch"
Add-Content -encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "copyToMain=$copyToMain"
Add-Content -encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "directCommit=$directCommit"
Expand Down
Loading