Repository navigation
139 lines (127 loc) · 4.85 KB
/
Copy pathrill-ui.yml
File metadata and controls
139 lines (127 loc) · 4.85 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
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
name: Build and Deploy Cloud UI to Netlify
on:
create:
tags:
- "v*"
branches:
- "release**"
push:
tags:
- "v*"
branches:
- "main"
- "release**"
paths:
- ".github/workflows/rill-ui.yml"
- "web-admin/**"
- "web-common/**"
- "netlify.toml"
workflow_dispatch:
inputs:
env:
description: "Environment"
required: true
default: "stage"
type: choice
options:
- stage
- prod
- test
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
jobs:
validate-sequential:
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'create' &&
( startsWith(github.ref_name, 'release') || startsWith(github.ref, 'refs/tags/v') )
)
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check Admin Migrations
run: |
./scripts/check_migrations.sh admin/database/postgres/migrations
- name: Check Runtime Migrations
run: |
./scripts/check_migrations.sh runtime/drivers/sqlite/migrations
- name: Notify Slack
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
notification_title: "{workflow} / {job} has {status_message}"
message_format: "{emoji} *{workflow} / {job}* {status_message} in <{repo_url}|{repo}>"
footer: "Linked Repo <{repo_url}|{repo}>"
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ANNOUNCE_DD }}
build:
# https://github.com/orgs/community/discussions/54860
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'create' &&
( startsWith(github.ref_name, 'release') || startsWith(github.ref, 'refs/tags/v') )
)
runs-on: ubuntu-22.04
needs: validate-sequential
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Setup Env variables from Inputs for Prod
if: ( github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') ) || ( github.event_name == 'workflow_dispatch' && inputs.env == 'prod' )
run: |-
echo "NETLIFY_SITE_ID=afb26917-7a60-47d9-81dc-c0babbb0d9a9" >> $GITHUB_ENV
echo "DOMAIN=rilldata.com" >> $GITHUB_ENV
echo "RILL_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Setup Env variables from Inputs for Stage
if: ( (github.event_name == 'push' || github.event_name == 'create') && startsWith(github.ref_name, 'release') ) || ( github.event_name == 'workflow_dispatch' && inputs.env == 'stage' )
run: |-
echo "NETLIFY_SITE_ID=e73ac785-882e-425a-8fc8-5432528bb374" >> $GITHUB_ENV
echo "DOMAIN=rilldata.io" >> $GITHUB_ENV
echo "RILL_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Setup Env variables from Inputs for Test
if: ( github.event_name == 'push' && startsWith(github.ref_name, 'main') ) || ( github.event_name == 'workflow_dispatch' && inputs.env == 'test' )
run: |-
echo "NETLIFY_SITE_ID=ad7b8d67-9b24-4b2a-8985-1a80b7b0ab11" >> $GITHUB_ENV
echo "DOMAIN=rilldata.in" >> $GITHUB_ENV
echo "RILL_VERSION=${GITHUB_SHA}" >> $GITHUB_ENV
- name: Build Cloud UI
run: |-
npm ci
npm run build -w web-admin
env:
RILL_UI_PUBLIC_RILL_ADMIN_URL: https://admin.${{ env.DOMAIN }}
RILL_UI_PUBLIC_PYLON_APP_ID: "26a0fdd2-3bd3-41e2-82bc-1b35a444729f"
RILL_UI_PUBLIC_VERSION: ${{ env.RILL_VERSION }}
- name: Deploy Cloud UI to Netlify ui.${{ env.DOMAIN }} - version ${{ env.RILL_VERSION }}
uses: nwtgck/actions-netlify@v3.0
with:
publish-dir: ./web-admin/build
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Cloud-admin ${{ github.ref_name }} deployed to ui.${{ env.DOMAIN }}"
production-deploy: true
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
netlify-config-path: ./netlify.toml
timeout-minutes: 1
- name: Notify Slack
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
notification_title: "{workflow} / {job} has {status_message}"
message_format: "{emoji} *{workflow} / {job}* {status_message} in <{repo_url}|{repo}>"
footer: "Linked Repo <{repo_url}|{repo}>"
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ANNOUNCE_DD }}