Skip to content

Instantly share code, notes, and snippets.

@timmyers
Created October 4, 2022 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmyers/6c14e9fa262486f73a39990545955c20 to your computer and use it in GitHub Desktop.
Save timmyers/6c14e9fa262486f73a39990545955c20 to your computer and use it in GitHub Desktop.
Pulumi IaC Github Workflow
name: pulumi
'on':
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
run-pulumi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: haya14busa/action-cond@v1
id: pulumi-op
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: preview
if_false: up
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::<AWS Account ID>:role/github
aws-region: us-west-2
- run: yarn install
- uses: pulumi/actions@v3
with:
command: ${{ steps.pulumi-op.outputs.value }}
comment-on-pr: true
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment