Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Deploy Player FC API

on:
push:
branches: [feature/github-actions]
pull_request:
branches:
- main

env:
AWS_REGION: af-south-1
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Destroy Player FC CDK Stack

on:
workflow_dispatch:
inputs:
confirm:
description: "Are you sure you want to delete: IacStack (y/n)?"
required: true

env:
AWS_REGION: af-south-1

permissions:
id-token: write
contents: read

jobs:
Destroy:
runs-on: ubuntu-latest
steps:
- name: Delete CDK stack
if: github.event.inputs.confirm != 'y'
run: |
exit 1
- name: Checkout repo
uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: "pip"

- name: Install Python dependencies
working-directory: ./iac
run: |
pip install -r requirements.txt

- name: Install AWS CDK
run: npm install -g aws-cdk

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5.1.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
role-session-name: GitHub_Actions_to_AWS_OIDC
mask-aws-account-id: true
- name: Destroy CDK stack
working-directory: ./iac
run: cdk destroy --all --force