forked from l2beat/l2beat
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (85 loc) · 3.22 KB
/
deploy-backend.yml
File metadata and controls
93 lines (85 loc) · 3.22 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
name: Deploy backend
concurrency:
group: backend-deployment
permissions:
contents: read
packages: write
on:
workflow_dispatch:
inputs:
force:
description: "Force deployment"
required: true
default: true
type: boolean
backend-prod-enabled:
description: "Deploy backend prod"
required: true
default: true
type: boolean
backend-staging-enabled:
description: "Deploy backend staging"
required: true
default: true
type: boolean
tvs-prod-enabled:
description: "Deploy tvs prod"
required: true
default: true
type: boolean
tvs-staging-enabled:
description: "Deploy tvs staging"
required: true
default: true
type: boolean
push:
branches:
- main
jobs:
check-changes:
uses: ./.github/workflows/check-changes.yml
with:
package: '@l2beat/backend'
force: ${{ github.event.inputs.force == 'true' }}
build:
needs: check-changes
if: needs.check-changes.outputs.should_deploy == 'true'
uses: ./.github/workflows/build-docker-image.yml
with:
project: backend
dockerfile: packages/backend/Dockerfile
secrets:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
deploy-backend-prod:
needs: build
if: (github.event_name == 'workflow_dispatch' && github.event.inputs['backend-prod-enabled'] == 'true') || (github.event_name != 'workflow_dispatch' && vars.DEPLOY_BACKEND_PROD_ENABLED != 'false')
uses: ./.github/workflows/deploy-to-coolify.yml
secrets:
COOLIFY_SERVER: ${{ secrets.COOLIFY_SERVER }}
COOLIFY_DEPLOY_API_KEY: ${{ secrets.COOLIFY_DEPLOY_API_KEY }}
COOLIFY_UUID: ${{ secrets.COOLIFY_BACKEND_PROD_ID }}
deploy-backend-staging:
needs: build
if: (github.event_name == 'workflow_dispatch' && github.event.inputs['backend-staging-enabled'] == 'true') || (github.event_name != 'workflow_dispatch' && vars.DEPLOY_BACKEND_STAGING_ENABLED != 'false')
uses: ./.github/workflows/deploy-to-coolify.yml
secrets:
COOLIFY_SERVER: ${{ secrets.COOLIFY_SERVER }}
COOLIFY_DEPLOY_API_KEY: ${{ secrets.COOLIFY_DEPLOY_API_KEY }}
COOLIFY_UUID: ${{ secrets.COOLIFY_BACKEND_STAGING_ID }}
deploy-tvs-prod:
needs: build
if: (github.event_name == 'workflow_dispatch' && github.event.inputs['tvs-prod-enabled'] == 'true') || (github.event_name != 'workflow_dispatch' && vars.DEPLOY_TVS_PROD_ENABLED != 'false')
uses: ./.github/workflows/deploy-to-coolify.yml
secrets:
COOLIFY_SERVER: ${{ secrets.COOLIFY_SERVER }}
COOLIFY_DEPLOY_API_KEY: ${{ secrets.COOLIFY_DEPLOY_API_KEY }}
COOLIFY_UUID: ${{ secrets.COOLIFY_TVS_PRODUCTION_ID }}
deploy-tvs-staging:
needs: build
if: (github.event_name == 'workflow_dispatch' && github.event.inputs['tvs-staging-enabled'] == 'true') || (github.event_name != 'workflow_dispatch' && vars.DEPLOY_TVS_STAGING_ENABLED != 'false')
uses: ./.github/workflows/deploy-to-coolify.yml
secrets:
COOLIFY_SERVER: ${{ secrets.COOLIFY_SERVER }}
COOLIFY_DEPLOY_API_KEY: ${{ secrets.COOLIFY_DEPLOY_API_KEY }}
COOLIFY_UUID: ${{ secrets.COOLIFY_TVS_STAGING_ID }}