-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (73 loc) · 2.92 KB
/
deploy.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
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
name: 🚀 Deploy to FTP
on:
push:
branches:
- main # trigger on push to main
tags:
- '*' # trigger on tag
jobs:
web-deploy-prd:
name: Deploy (PRD)
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/0.') # only execute this when tag 0.* is
steps:
- name: 🚚 Checkout code
uses: actions/[email protected]
- name: 🔒 Set up PHP environment variables
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
API_ID: ${{ secrets.API_ID }}
API_SECRET: ${{ secrets.API_SECRET }}
run: |
# Replace placeholders in config files with secret values
sed -i "s/__DB_HOST__/$DB_HOST/g" config/db.php
sed -i "s/__DB_USERNAME__/$DB_USERNAME/g" config/db.php
sed -i "s/__DB_PASSWORD__/$DB_PASSWORD/g" config/db.php
sed -i "s/__DB_NAME__/$DB_NAME/g" config/db.php
sed -i "s/__API_ID__/$API_ID/g" config/api_blizzard.php
sed -i "s/__API_SECRET__/$API_SECRET/g" config/api_blizzard.php
- name: 📂 Deploy website to FTP (PRD)
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
port: 21
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PW }}
local-dir: ./ # Path to your project files
server-dir: / # Remote directory on your FTP server
log-level: minimal
web-deploy-sat:
name: Deploy (SAT)
runs-on: ubuntu-latest
steps:
- name: 🚚 Checkout code
uses: actions/[email protected]
- name: 🔒 Set up PHP environment variables
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
API_ID: ${{ secrets.API_ID }}
API_SECRET: ${{ secrets.API_SECRET }}
run: |
# Replace placeholders in config files with secret values
sed -i "s/__DB_HOST__/$DB_HOST/g" config/db.php
sed -i "s/__DB_USERNAME__/$DB_USERNAME/g" config/db.php
sed -i "s/__DB_PASSWORD__/$DB_PASSWORD/g" config/db.php
sed -i "s/__DB_NAME__/$DB_NAME/g" config/db.php
sed -i "s/__API_ID__/$API_ID/g" config/api_blizzard.php
sed -i "s/__API_SECRET__/$API_SECRET/g" config/api_blizzard.php
- name: 📂 Deploy website to FTP (SAT)
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
port: 21
username: ${{ secrets.FTP_USER_SAT }}
password: ${{ secrets.FTP_PW_SAT }}
local-dir: ./ # Path to your project files
server-dir: / # Remote directory on your FTP server
log-level: minimal