-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (40 loc) · 2.11 KB
/
deploy-prod-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Deploy to prod skills
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: commands on server
uses: garygrossgarten/github-action-ssh@release
with:
host: ${{ secrets.PROD_SERVER_HOST }}
username: ${{ secrets.PROD_SERVER_USER }}
password: ${{ secrets.PROD_SERVER_PASSWORD }}
command: |
cd ~/skills_api-prod-new &&
git pull origin main &&
rm -f .env &&
touch .env &&
echo "DEBUG=${{ secrets.DJANGO_DEBUG }}" >> .env &&
echo "DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }}" >> .env &&
echo "DATABASE_NAME=${{ secrets.PROD_DATABASE_NAME }}" >> .env &&
echo "DATABASE_PASSWORD=${{ secrets.PROD_DATABASE_PASSWORD }}" >> .env &&
echo "DATABASE_USER=${{ secrets.PROD_DATABASE_USER }}" >> .env &&
echo "DATABASE_HOST=${{ secrets.DEV_DATABASE_HOST }}" >> .env &&
echo "DATABASE_PORT=${{ secrets.DEV_DATABASE_PORT }}" >> .env &&
echo "SELECTEL_ACCOUNT_ID=${{ secrets.DEV_SELECTEL_ACCOUNT_ID }}" >> .env &&
echo "SELECTEL_CONTAINER_NAME=${{ secrets.SELECTEL_CONTAINER_NAME }}" >> .env &&
echo "SELECTEL_SERVICE_USERNAME=${{ secrets.DEV_SELECTEL_SERVICE_USERNAME }}" >> .env &&
echo "SELECTEL_SERVICE_PASSWORD=${{ secrets.SELECTEL_SERVICE_PASSWORD }}" >> .env &&
echo "SELECTEL_PROJECT_ID=${{ secrets.SELECTEL_PROJECT_ID }}" >> .env &&
echo "SELECTEL_PROJECT_NAME=${{ secrets.SELECTEL_PROJECT_NAME }}" >> .env &&
echo "SELECTEL_READ_FILES_DOMAIN=${{ secrets.SELECTEL_READ_FILES_DOMAIN }}" >> .env &&
echo "YOOKASSA_API_KEY=${{ secrets.DEV_YOOKASSA_API_KEY }}" >> .env &&
echo "YOOKASSA_SHOP_ID=${{ secrets.DEV_YOOKASSA_SHOP_ID }}" >> .env &&
docker compose -f docker-compose.prod-ci.yml stop &&
docker compose -f docker-compose.prod-ci.yml up --build -d
# echo "DEBUG=${{ secrets.DJANGO_DEBUG }}" >> .env &&
# echo "DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }}" >> .env &&