This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.66 KB
/
build-docker.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
name: Deploy to k8s
on:
push:
branches:
- develop
- main
env:
ILLA_MIXPANEL_API_KEY: ${{ secrets.ILLA_MIXPANEL_API_KEY }}
ILLA_AMPLITUDE_API_KEY: ${{ secrets.ILLA_AMPLITUDE_API_KEY }}
ILLA_MUI_LICENSE: ${{ secrets.ILLA_MUI_LICENSE }}
ILLA_SENTRY_AUTH_TOKEN: ${{ secrets.ILLA_SENTRY_AUTH_TOKEN }}
DO_CLUSTER: ${{ secrets.DO_CLUSTER }}
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_PWD: ${{ secrets.DOCKER_PWD }}
DO_TOKEN: ${{ secrets.DO_TOKEN }}
ILLA_INTERCOM_APP_ID: ${{ secrets.ILLA_INTERCOM_APP_ID }}
ILLA_POSTHOG_KEY: ${{ secrets.ILLA_POSTHOG_KEY }}
jobs:
build:
name: Build website
runs-on: ubuntu-latest
environment:
name:
${{ (github.ref == 'refs/heads/main') && 'production' || (github.ref ==
'refs/heads/develop') && 'test' || (github.ref == 'refs/heads/beta') &&
'beta' }}
env:
ILLA_API_BASE_URL: ${{ vars.ILLA_API_BASE_URL }}
ILLA_APP_ENV: ${{ vars.ILLA_APP_ENV }}
ILLA_CLOUD_URL: ${{ vars.ILLA_CLOUD_URL }}
ILLA_MARKET_URL: ${{ vars.ILLA_MARKET_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
- uses: pnpm/action-setup@v2
with:
version: 8.7.0
- name: Install dependencies
run: pnpm install --frozen-lockfile
# - name: Install doctl
# uses: digitalocean/action-doctl@v2
# with:
# token: ${{ secrets.DO_TOKEN }}
# - name: Setup kubectl
# run: |
# doctl kubernetes cluster kubeconfig save $DO_CLUSTER
# - name: Install kubectl
# run: |
# sudo snap install kubectl --classic
- name: Build website
run: |
echo "Building for $GITHUB_REF_NAME branch,ILLA APP ENV is $ILLA_APP_ENV"
pnpm build
- name: Build Docker
run: |
docker build --cache-from=tipisai-fe -f Dockerfile -t tipisai-fe .
- name: Push application Docker image
run: |
docker login -u $DOCKER_LOGIN -p $DOCKER_PWD
docker tag tipisai-fe "illasoft/tipisai-fe:$GITHUB_REF_NAME"
docker push "illasoft/tipisai-fe:$GITHUB_REF_NAME"
# - uses: actions/checkout@v4
# with:
# repository: tipisai/k8s-application-do
# token: ${{ secrets.ILLA_BOT_TOKEN }}
# path: k8s-application-do
# - name: Deploy to Kubernetes
# run: |
# cd k8s-application-do/namespace-$ILLA_APP_ENV
# kubectl apply -f ./tipisai-cloud-frontend/ -n $ILLA_APP_ENV
# kubectl -n $ILLA_APP_ENV rollout restart deployment tipisai-cloud-frontend