diff --git a/.github/workflows/_run_pulumi.yaml b/.github/workflows/_run_pulumi.yaml new file mode 100644 index 000000000..1c5ad9aae --- /dev/null +++ b/.github/workflows/_run_pulumi.yaml @@ -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 }}" diff --git a/.github/workflows/manual-environment-greeting.yaml b/.github/workflows/manual-environment-greeting.yaml new file mode 100644 index 000000000..cacac7e75 --- /dev/null +++ b/.github/workflows/manual-environment-greeting.yaml @@ -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