-
Notifications
You must be signed in to change notification settings - Fork 12
81 lines (73 loc) · 2.67 KB
/
deploy.yml
File metadata and controls
81 lines (73 loc) · 2.67 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
name: 🚀 Release and Deploy
on:
push:
branches:
- dev
- staging
- main
- testnet
pull_request:
types:
- closed
branches:
- dev
- staging
- main
- testnet
jobs:
release-and-deploy:
runs-on: ubuntu-latest
# Only run on push events OR on merged pull requests (not closed-without-merge)
if: github.event_name == 'push' || github.event.pull_request.merged == true
steps:
- name: 🛎️ Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full commit history
- name: ⚙️ Setup pnpm
uses: pnpm/action-setup@v4.0.0
- name: 🔧 Set up Node.js 20.x
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'pnpm'
registry-url: 'https://npm.pkg.github.com'
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile
- name: 🔖 Run Semantic Release
run: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'
- name: 🏗️ Build app
env:
VITE_NETWORK: ${{ github.ref == 'refs/heads/testnet' && 'testnet' || 'mainnet' }}
VITE_QLI_API_URL: ${{ secrets.QLI_API_URL }}
VITE_QUBIC_RPC_URL: ${{ github.ref == 'refs/heads/testnet' && secrets.QUBIC_RPC_URL_TESTNET || secrets.QUBIC_RPC_URL }}
VITE_STATIC_API_URL: |
${{
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/testnet') && secrets.STATIC_API_URL ||
github.ref == 'refs/heads/staging' && secrets.STATIC_API_URL_STAGING ||
secrets.STATIC_API_URL_DEV
}}
run: pnpm run build
- name: 📤 Deploy to the corresponding environment
uses: SamKirkland/FTP-Deploy-Action@4.3.3
with:
server: ${{ secrets.FTP_SERVER }}
username: |
${{
github.ref == 'refs/heads/main' && secrets.FTP_USERNAME_PROD ||
github.ref == 'refs/heads/testnet' && secrets.FTP_USERNAME_TESTNET ||
github.ref == 'refs/heads/staging' && secrets.FTP_USERNAME_STAGING ||
secrets.FTP_USERNAME_DEV
}}
password: |
${{
github.ref == 'refs/heads/main' && secrets.FTP_PASSWORD_PROD ||
github.ref == 'refs/heads/testnet' && secrets.FTP_PASSWORD_TESTNET ||
github.ref == 'refs/heads/staging' && secrets.FTP_PASSWORD_STAGING ||
secrets.FTP_PASSWORD_DEV
}}
local-dir: dist/
protocol: ftps