-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f02bcb
commit 8be179a
Showing
2 changed files
with
12 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,28 +5,29 @@ on: | |
branches: ["deploy"] | ||
|
||
jobs: | ||
build-and-deploy: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Copy context to server | ||
uses: appleboy/[email protected] | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install rsync | ||
run: sudo apt-get update && sudo apt-get install -y rsync | ||
- name: Copy code to server using rsync | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: 37.139.41.110 | ||
username: ubuntu | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
source: "./" | ||
target: "/opt/backend-deploy/" | ||
|
||
script: | | ||
rsync -avz -e "ssh -p 22" ./ [email protected]:/opt/backend-deploy/ | ||
- name: Build and deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: 37.139.41.110 | ||
username: ubuntu | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
script: | | ||
sudo apt update && sudo apt install -y docker.io docker-compose | ||
cd /opt/backend-deploy/ | ||
sudo docker-compose pull # Pull latest images if you are using a registry | ||
sudo docker-compose build --no-cache # Build services | ||
sudo docker-compose up -d --remove-orphans # Start services in detached mode | ||
sudo docker-compose build --no-cache | ||
sudo docker-compose up -d --remove-orphans |
This file was deleted.
Oops, something went wrong.