Skip to content

update ami

update ami #12

name: Docker Build on EC2 Instance
on:
push:
branches:
- feat/deploy
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: SSH and Execute Build on EC2
uses: appleboy/ssh-action@master
with:
command_timeout: "60m"
host: 44.200.189.129
username: ubuntu # Usually 'ubuntu' or 'ec2-user'
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
nvcc --version
echo CUDA_HOME=$CUDA_HOME
#export CUDA_HOME=/usr/local/cuda
git clone https://github.com/OpenAdaptAI/SoM
cd SoM
git checkout feat/deploy
ls -al
# Login to AWS ECR
$(aws ecr get-login --no-include-email --region us-east-1)
# Build the image
sudo docker build -t openadapt .
#sudo docker run -d -p 80:80 openadapt
# Tag the image for the ECR repository
docker tag openadapt:latest 726461418004.dkr.ecr.us-east-1.amazonaws.com/openadapt:latest
# Push the image to ECR
docker push 726461418004.dkr.ecr.us-east-1.amazonaws.com/openadapt:latest