Skip to content

Fix cd

Fix cd #60

Workflow file for this run

name: Deploy to AWS EC2
on:
push:
branches: [main]
pull_request:
types: [closed]
branches: [main]
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
if: github.event_name == 'push' || github.event.pull_request.merged == true
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add EC2 SSH key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.EC2_SSH_KEY }}
- name: Add EC2 host to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H "${{ secrets.EC2_HOST }}" >> ~/.ssh/known_hosts
- name: Who am I on EC2
run: |
ssh "${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}" "whoami; echo \$HOME; ls -la /home/ubuntu/src/FastAPI_movie_theater | head"