Skip to content

Merge pull request #34 from mischaikow/new-website-code #48

Merge pull request #34 from mischaikow/new-website-code

Merge pull request #34 from mischaikow/new-website-code #48

Workflow file for this run

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