-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.09 KB
/
cd.yml
File metadata and controls
47 lines (39 loc) · 1.09 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
# .github/workflows/cd.yml
name: Continuous Delivery
on:
push:
branches: ["master", "release/*"]
jobs:
staging:
name: Deploy Staging to Railway
if: github.ref != 'refs/heads/master' && startsWith(github.ref, 'refs/heads/release/')
runs-on: ubuntu-latest
environment:
name: staging
url: https://be-staging.zekhoi.dev
steps:
- name: Checkout code from GitHub
uses: actions/checkout@v3
- name: Install Railway
run: npm i -g @railway/cli
- name: Deploy
run: railway up
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
production:
name: Deploy Production to Railway
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
environment:
name: production
url: https://backend-synrgy-fp-c.zekhoi.dev/
# needs: [staging]
steps:
- name: Checkout code from GitHub
uses: actions/checkout@v3
- name: Install Railway
run: npm i -g @railway/cli
- name: Deploy
run: railway up
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}