fix image #4
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
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push Docker | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/heartlink_back:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Deploy to server | |
uses: appleboy/ssh-action@v0.1.3 | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
port: ${{ secrets.SSH_PORT }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SSH_PASSPHRASE }} | |
script: | | |
docker pull sachawildcode/heartlink_back:latest && | |
docker compose up -d --force-recreate |