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

test #87

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

test #87

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/_run_pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# .github/workflows/_run_pulumi.yaml
name: Run Pulumi

on:
workflow_call:
inputs:
work-dir:
description: 'The working directory for Pulumi'
required: true
type: string
stack:
description: 'The stack to update'
required: true
type: string
runner-stage:
description: 'The runner stage'
required: true
type: string
apply:
description: 'Flag to apply changes'
required: true
type: boolean

jobs:
print-vars:
runs-on: ubuntu-latest
steps:
- name: Print variables
run: |
echo "Work Directory: ${{ inputs.work-dir }}"
echo "Stack: ${{ inputs.stack }}"
echo "Runner Stage: ${{ inputs.runner-stage }}"
echo "Apply Flag: ${{ inputs.apply }}"
38 changes: 38 additions & 0 deletions .github/workflows/manual-environment-greeting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: update-infra-stack-manually

on:
workflow_dispatch:
inputs:
stack:
description: 'Select the specific stack to update (e.g., foo-prod)'
type: choice
required: true
options:
- foo-prod

env:
AWS_DEFAULT_REGION: us-east-1

jobs:
extract-and-set-vars:
runs-on: ubuntu-latest
outputs:
stack-prefix: ${{ steps.set-vars.outputs.stack-prefix }}
stack-suffix: ${{ steps.set-vars.outputs.stack-suffix }}
steps:
- name: Extract stack parts and set output
id: set-vars
run: |
STACK=${{ inputs.stack }}
IFS='-' read -r STACK_PREFIX STACK_SUFFIX <<< "$STACK"
echo "::set-output name=stack-prefix::$STACK_PREFIX"
echo "::set-output name=stack-suffix::$STACK_SUFFIX"

update-stack:
needs: extract-and-set-vars
uses: ./.github/workflows/_run_pulumi.yaml
with:
work-dir: ./.infrastructure/${{ needs.extract-and-set-vars.outputs.stack-prefix }}
stack: ${{ inputs.stack }}
runner-stage: ${{ needs.extract-and-set-vars.outputs.stack-suffix }}
apply: true