Skip to content

Commit 68a5d89

Browse files
authored
Merge pull request #3 from contributor-pw/fix_build_ci_cd
feat: update build ci cd
2 parents 23b4c40 + 8c88469 commit 68a5d89

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy on Push
33
on:
44
push:
55
branches:
6-
- master # Or your default branch, e.g., master
6+
- master
77

88
jobs:
99
deploy:
@@ -14,17 +14,22 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616
with:
17-
clean: false
17+
clean: true
1818

19-
- name: Deploy services
19+
- name: Synchronize configuration to permanent directory
20+
run: |
21+
# Копируем свежие версии конфигов из временной папки (_work)
22+
# в постоянную папку проекта (/opt/apps/relaxy).
23+
# Флаг --delete удалит старые файлы, если вы их переименовали или удалили.
24+
sudo rsync -av --delete ${{ github.workspace }}/ /opt/apps/relaxy/ --exclude 'data' --exclude '.git'
25+
26+
- name: Deploy services from permanent directory
2027
env:
2128
DOMAIN: ${{ secrets.DOMAIN }}
2229
EMAIL: ${{ secrets.EMAIL }}
2330
run: |
24-
# Navigate to your project directory on the server
25-
cd ${{ github.workspace }}
31+
# Переходим в постоянную папку проекта
32+
cd /opt/apps/relaxy
2633
27-
# Rebuild and restart your services with Docker Compose
28-
# Environment variables are passed from the 'env' context above
29-
# We explicitly specify `nginx` to ensure only the proxy server is started on deploy.
30-
sudo -E docker compose -f docker-compose.yml up -d --build --force-recreate --remove-orphans --wait nginx
34+
# Запускаем docker-compose уже отсюда.
35+
sudo -E docker compose up -f docker-compose.yml -d --build --force-recreate --remove-orphans --wait nginx

0 commit comments

Comments
 (0)