I have a Laravel project with a GitHub Action workflow, it triggers on code push, then logged into EC2, and execute following commands:
- name: SSH into EC2 instance
uses: appleboy/ssh-action@master
with:
host: ${{secrets.EC2_HOST}}
username: ${{secrets.EC2_USERNAME}}
key: ${{ secrets.EC2_SECRET }}
script: |
cd /var/www/project
**git pull origin test**
cp .env.production .env
cp docker-compose.test.yml docker-compose.yml
docker-compose build
docker-compose down
docker-compose up -d
I am succesfully logged into server and when the following scripts runs.
Problem faced:
The command **git pull origin test**
against the EC2 server is failing – due to merge conflict.
I don't want to execute further scripts and abort here. Or can undo changes made by any previous script.
Thanks in advance.