Update workflow #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WebsiteV2 - Build and Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_COMPOSE_FILE: "compose.yaml" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Deploy Docker image on EC2 | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.USER_NAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/ubuntu/app/defisaver-forkooor && | |
git checkout main && | |
git fetch --all && | |
git pull origin main && | |
docker compose up --build -d |