diff --git a/.github/workflows/save_CF_template.yml b/.github/workflows/save_CF_template.yml new file mode 100644 index 0000000..7cfdc77 --- /dev/null +++ b/.github/workflows/save_CF_template.yml @@ -0,0 +1,39 @@ +name: Save CloudFormation template +# based on https://github.com/AdminTurnedDevOps/YouTube/blob/main/.github/workflows/main.yml + +on: + # When it works, uncomment these 2 lines: + # release: + # types: [published] + # push: + # branches: + # - CF-artifact + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + aws_cdk: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: install npm + uses: actions/setup-node@v3 + + - name: Install AWS CDK + run: 'npm install -g aws-cdk' + + - name: Install Requirements + run: 'pip3 install -r requirements.txt' + + - name: Run CDK synth + run: 'cdk synth' + + - name: Save CloudFormation template + uses: actions/upload-artifact@v3 + with: + name: ec2-instance.template.json + path: ./cdk.out/ec2-instance.template.json