here is my problem.
I have a github repository and I want to copy it into a aws EC2 instance automatically with a github-actions.yml file.
In github secrets, I added the following secrets:
- AWS_HOST
- AWS_ROOT_DIR_PATH
- AWS_USER
- SSH_PRIVATE_KEY
here is the github-actions.yml:
name: Deploy to EC2 (AWS)
on:
push:
branches:
masterjobs:
deploy:
runs-on: ubuntu-lateststeps:
name: Checkout repository
uses: actions/checkout@v2name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ‘just-a-placeholder-so-we-dont-get-errors’name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.AWS_HOST }} >> ~/.ssh/known_hostsname: Deploy with rsync
run: rsync -anvz ./* ${{ secrets.AWS_USER }}@${{ secrets.AWS_HOST }}:${{ secrets.AWS_ROOT_DIR_PATH }}
When I check into section “Actions” in github, deploiement is succeeded but no files have been copied into the folder “AWS_ROOT_DIR_PATH” in my aws EC2.
Maybe you can help me to solve this issue.
I tried to run github-actions.yml and I should have a folder at the location “AWS_ROOT_DIR_PATH” where all the content of my github repository would have been copied