-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (95 loc) · 3.12 KB
/
deploy.yml
File metadata and controls
108 lines (95 loc) · 3.12 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Deploy to Production
on:
push:
branches: [main]
workflow_dispatch:
jobs:
# Frontend Deployment
deploy-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install dependencies
working-directory: src/frontend
run: npm install
- name: Build frontend
working-directory: src/frontend
run: npm run build
env:
NODE_ENV: production
VITE_BASE_URL: "/"
VITE_API_URL: "https://api.evren.dev/"
VITE_SITE_URL: "https://evren.dev"
VITE_DEFAULT_LOCALE: "en"
VITE_FALLBACK_LOCALE: "en"
VITE_SUPPORTED_LOCALES: "de,en"
VITE_RECAPTCHA_SITE_KEY_V2: ${{ secrets.VITE_RECAPTCHA_SITE_KEY_V2 }}
VITE_RECAPTCHA_SITE_KEY_V3: ${{ secrets.VITE_RECAPTCHA_SITE_KEY_V3 }}
VITE_RECAPTCHA_SECRET_KEY_V2: ${{ secrets.VITE_RECAPTCHA_SECRET_KEY_V2 }}
VITE_RECAPTCHA_SECRET_KEY_V3: ${{ secrets.VITE_RECAPTCHA_SECRET_KEY_V3 }}
VITE_AHASEND_APIKEY: ${{ secrets.VITE_AHASEND_APIKEY }}
- name: Deploy to FTP (Frontend)
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./src/frontend/dist/
server-dir: /httpdocs/
exclude: |
**/.git*
**/.git*/**
**/node_modules/**
**/.DS_Store
# Backend Deployment
deploy-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
working-directory: src/backend
run: dotnet restore
- name: Build backend
working-directory: src/backend
run: dotnet build --no-restore -c Release
- name: Publish backend
working-directory: src/backend
run: dotnet publish -c Release -o publish --no-build
- name: Create production Secret.json
working-directory: src/backend/publish
run: |
cat > Secret.json << EOF
{
"Google": {
"Recaptcha.SecretKey": "${{ secrets.VITE_RECAPTCHA_SECRET_KEY_V2 }}"
},
"Ahasend": {
"ApiUrl": "https://api.ahasend.com/v1/email/send",
"Apikey": "${{ secrets.VITE_AHASEND_APIKEY }}"
}
}
EOF
- name: Deploy to FTP (Backend)
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_HOST_API }}
username: ${{ secrets.FTP_USERNAME_API }}
password: ${{ secrets.FTP_PASSWORD_API }}
local-dir: ./src/backend/publish/
server-dir: /httpdocs/
exclude: |
**/.git*
**/.git*/**
**/obj/**
**/bin/**
**/.DS_Store