diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index be4529b..ba40701 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,6 +6,9 @@ on: jobs: app_deployment: runs-on: ubuntu-latest + env: + IMAGE_VERSION: "1123" + IMAGE_USERNAME: theoafactor steps: - name: 'Checkout the repo' uses: actions/checkout@v4 @@ -30,6 +33,27 @@ jobs: ssh -o StrictHostKeyChecking=no -i ssh_key ubuntu@ec2-52-90-75-73.compute-1.amazonaws.com ' sudo apt-get update + + ## install docker + # Add Docker's official GPG key: + sudo apt-get update + sudo apt-get install ca-certificates curl + sudo install -m 0755 -d /etc/apt/keyrings + sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + sudo chmod a+r /etc/apt/keyrings/docker.asc + + # Add the repository to Apt sources: + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update + + sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + ## pull the image into the EC2 instance + sudo docker pull theoafactor/booksfinder:1123 + + sudo docker run -d -p 80:80 theoafactor/booksfinder:1123 ' \ No newline at end of file diff --git a/ssh_test b/ssh_test new file mode 100644 index 0000000..345e6ae --- /dev/null +++ b/ssh_test @@ -0,0 +1 @@ +Test