Skip to content

Commit

Permalink
manual with inputs and conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
sg committed Jun 26, 2024
1 parent 02637eb commit 938b1c7
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/cdk-deploy-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@ name: Deploy a CDK stack to dev env with OIDC

on:
workflow_dispatch:
# push:
# branches:
# - main
inputs:
environment:
description: "AWS environment to deploy to"
type: choice
required: true
default: "dev"
options:
- dev

pull_request:
types:
- closed
branches:
- main

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
id-token: write
contents: read

jobs:
# Only run if a pull request is merged
if_merged:
if: github.event.pull_request.merged == true
# Run job for every environment listed in arrary
deploy:
runs-on: ubuntu-latest

strategy:
matrix:
# The comma separated array
env: [dev]
runs-on: ubuntu-latest
environment: ${{ matrix.env }}

environment: ${{ github.event.inputs.environment || matrix.env }}

if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'

steps:
- name: Checkout Repository
Expand Down

0 comments on commit 938b1c7

Please sign in to comment.