-
Notifications
You must be signed in to change notification settings - Fork 15
169 lines (159 loc) · 7.12 KB
/
build-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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: build and deploy grillchat in production
on:
push:
branches:
- main
- deploy/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
front_build:
strategy:
matrix:
apps: [main, deploy]
isMaster:
- ${{ contains(github.ref, 'main') }}
isDeploy:
- ${{ startsWith(github.ref, 'refs/heads/deploy/') }}
exclude:
- isMaster: false
apps: main
- isMaster: true
apps: deploy
name: Build ${{ matrix.apps }} Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base ${{ matrix.apps }}
uses: './.github/actions/common-ci-setup'
with:
username_input: ${{ secrets.DOCKER_USERNAME }}
password_input: ${{ secrets.DOCKER_PASSWORD }}
app_input: ${{ matrix.apps }}
- name: Build mainnet production image
if: matrix.apps == 'main'
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: docker/Dockerfile
push: true
build-args: |
GH_NEXTAUTH_URL=https://grillapp.net/c/api/auth
GH_NEXT_PUBLIC_BASE_PATH=/c
GH_NEXT_PUBLIC_SUBSTRATE_URL=https://para.subsocial.network
GH_NEXT_PUBLIC_SUBSTRATE_WSS=wss://para.subsocial.network
GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=https://sub-data-hub.subsocial.network/graphql
GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=wss://sub-data-hub.subsocial.network/graphql-ws
GH_DATAHUB_QUEUE_URL=https://sub-queue-data-hub.subsocial.network/graphql
GH_NOTIFICATIONS_URL=https://sub-notif-data-hub.subsocial.network/graphql
GH_NEXT_PUBLIC_APP_ID=1
GH_NEXT_PUBLIC_NOTIFICATION_APP_ID=BECyoVsDLEgsOj9MvhoetL3YGYZVCE5RzhADmBugpp0hu7QBV_xG8veiT_qAFxF9S8qXKhPvaPiD5oMrdWrFNB0
GH_NEXT_PUBLIC_TELEGRAM_NOTIFICATION_BOT=https://t.me/grill_notifications_bot/
GH_NEXT_PUBLIC_OFFCHAIN_POSTING_HUBS=12662
GH_NEXT_PUBLIC_SPACE_IDS=12659,12660,12455,12662
GH_NEXT_PUBLIC_AMP_ID=2eeca0e8a0163c89e3f023c971e426a6
GH_NEXT_PUBLIC_SQUID_URL=https://squid.subsquid.io/subsocial/graphql
GH_NEXT_PUBLIC_COMMUNITY_HUB_ID=12455
GH_NEXT_PUBLIC_GA_ID=G-TP1XEFNHQD
GH_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=grill-web-push.firebaseapp.com
GH_NEXT_PUBLIC_FIREBASE_PROJECT_ID=grill-web-push
GH_NEXT_PUBLIC_FIREBASE_API_KEY=AIzaSyCdu_lvl18590HFoAXTysuKStaJJkaA4h4
GH_NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=grill-web-push.appspot.com
GH_NEXT_PUBLIC_FIREBASE_MESSAGING_ID=762898090466
GH_NEXT_PUBLIC_FIREBASE_APP_ID=1:762898090466:web:8b27ce87e8cb476f95d1bb
GH_NEXT_PUBLIC_PROPOSALS_HUB=27942
target: runner
tags: |
${{ env.image }}
dappforce/subsocial-web-app:mainnet-grillchat-master-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Build staging docker image
if: matrix.apps == 'deploy'
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: docker/Dockerfile
push: true
build-args: |
GH_NEXT_PUBLIC_AMP_ID=71bf5a46800fedba5e9a01243b988164
GH_NEXT_PUBLIC_SQUID_URL=https://squid.subsquid.io/subsocial/graphql
GH_NEXT_PUBLIC_COMMUNITY_HUB_ID=12467
GH_NEXT_PUBLIC_GA_ID=fake
GH_IPFS_WRITE_URL=https://gw-seattle.crustcloud.io
GH_IPFS_PIN_URL=https://test-pin.crustcloud.io/psa
GH_NEXT_PUBLIC_NOTIFICATION_APP_ID=BJaKjx7xtiIXtSUT8tR6VDG0WwhFwdqOqp8L5kc6alGBUtndnlV_DUJ6sze_z70VEBOKk4AT_wZTJqE9dC7sbEQ
GH_NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=gl-notifications-dev.firebaseapp.com
GH_NEXT_PUBLIC_FIREBASE_PROJECT_ID=gl-notifications-dev
GH_NEXT_PUBLIC_FIREBASE_API_KEY=AIzaSyC7pSekdJQ0PpUDCY4eEkEeDGCazVES6QI
GH_NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=gl-notifications-dev.appspot.com
GH_NEXT_PUBLIC_FIREBASE_MESSAGING_ID=581626459774
GH_NEXT_PUBLIC_FIREBASE_APP_ID=1:581626459774:web:6b7098eb48c0b142f50a2f
GH_NEXT_PUBLIC_SUBSTRATE_URL=https://para.subsocial.network
GH_NEXT_PUBLIC_SUBSTRATE_WSS=wss://para.subsocial.network
GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=https://sub-data-hub.subsocial.network/graphql
GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=wss://ownership-pallet-data-hub-core.subsocial.network/graphql-ws
GH_DATAHUB_QUEUE_URL=https://ownership-pallet-data-hub-queue.subsocial.network/graphql
GH_NOTIFICATIONS_URL=https://ownership-pallet-notif-data-hub-core.subsocial.network/graphql
GH_NEXT_PUBLIC_OFFCHAIN_POSTING_HUBS=12468
GH_NEXT_PUBLIC_PROPOSALS_HUB=12364
GH_NEXT_PUBLIC_APP_ID=12364
GH_NEXT_PUBLIC_SPACE_IDS=12466,12467,12468,12660
GH_NEXT_PUBLIC_TELEGRAM_NOTIFICATION_BOT=https://t.me/g_notif_staging_bot/
# without base path
# GH_NEXTAUTH_URL=https://${{ env.name }}.subsocial.network
# with base path
GH_NEXTAUTH_URL=https://${{ env.name }}.subsocial.network/c/api/auth
GH_NEXT_PUBLIC_BASE_PATH=/c
target: runner
tags: |
${{ env.image }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
front_deploy:
strategy:
matrix:
apps: [main, deploy]
isMaster:
- ${{ contains(github.ref, 'main') }}
isDeploy:
- ${{ startsWith(github.ref, 'refs/heads/deploy/') }}
exclude:
- isMaster: false
apps: main
- isMaster: true
apps: deploy
name: deploy ${{ matrix.apps }}
runs-on: ubuntu-latest
needs: front_build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: prod deploy ${{ matrix.apps }}
if: github.ref == 'refs/heads/main'
uses: './.github/actions/common-cd-setup'
with:
token_input: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN_PROD }}
k8s_input: ${{ secrets.K8S_PROD }}
app_input: ${{ matrix.apps }}
zone_input: ${{ secrets.CF_ZONE }}
mail_input: ${{ secrets.CF_MAIL }}
tokens_input: ${{ secrets.CF_TOKEN }}
- name: stage deploy ${{ matrix.apps }}
if: startsWith(github.ref, 'refs/heads/deploy/')
uses: './.github/actions/common-cd-setup'
with:
token_input: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN_STAGING }}
k8s_input: ${{ secrets.K8S_STAGING }}
app_input: ${{ matrix.apps }}
zone_input: ${{ secrets.CF_ZONE }}
mail_input: ${{ secrets.CF_MAIL }}
tokens_input: ${{ secrets.CF_TOKEN }}