Merge pull request #28 from mischaikow/certbot-three #42
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: Deploy to EC2 and build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::662775645668:role/mischaikow-com-github-access | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: us-east-1 | |
- name: Pull & build repository | |
id: repo-build | |
run: | | |
echo "CMDID=$(aws ssm send-command \ | |
--instance-ids 'i-03c0a5504af2c0cff' \ | |
--document-name 'AWS-RunShellScript' \ | |
--parameters commands='bash /home/ec2-user/website/build_run_docker.sh' \ | |
--query 'Command.CommandId' --output text)" >> $GITHUB_ENV | |
- name: Wait... | |
run: sleep 200s | |
- name: Print Results | |
run: | | |
aws ssm list-command-invocations \ | |
--command-id "${{ env.CMDID }}" \ | |
--details \ | |
--query "CommandInvocations[*].CommandPlugins[*].Output[]" \ | |
--output text |