Cloudformation deployment #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cloudformation deployment | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deployment: | |
name: Cloudformation deployment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-central-1 | |
- name: Deploy AWS CloudFormation - networking stack | |
uses: aws-actions/aws-cloudformation-github-deploy@v1 | |
with: | |
name: networking | |
template: cloudFormation/networking.yaml | |
no-fail-on-empty-changeset: "1" | |
- name: Deploy AWS CloudFormation - WordPress stack | |
uses: aws-actions/aws-cloudformation-github-deploy@v1 | |
with: | |
name: wordPressStack | |
template: cloudFormation/wordPressStack.yaml | |
capabilities: CAPABILITY_NAMED_IAM | |
no-fail-on-empty-changeset: "1" | |
- name: Print server public IP | |
run: | | |
PUBLIC_IP=$(aws cloudformation describe-stacks --stack-name wordPressStack --query 'Stacks[0].Outputs[?OutputKey==`publicIp`].OutputValue' --output text) | |
echo "Server public IP: $PUBLIC_IP" | |
echo "Server public IP: \`$PUBLIC_IP\`" >> $GITHUB_STEP_SUMMARY |