forked from netless-io/flat
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 2.05 KB
/
deploy-web-dev.yml
File metadata and controls
65 lines (55 loc) · 2.05 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
name: Deploy Flat Web Dev
on:
push:
branches:
- "main"
paths:
- "config/**"
- "web/flat-web/**"
- "packages/flat-components/src/**"
- "packages/flat-i18n/locales/**"
- "packages/flat-types/src/**"
- ".github/workflows/deploy-web-dev.yml"
jobs:
deploy-flat-web-dev:
environment: development
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
node ./scripts/ci/remove-workspace-packages.js web
node ./scripts/ci/remove-package-scripts-hooks.js
# failure automatically retries 3 times
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
- name: Build flat web development
run: yarn workspace flat-web build -m development
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Reset dockerignore
run: |
echo "*" > .dockerignore
echo "!web/flat-web/dist" >> .dockerignore
echo "!web/flat-web/deploy/nginx" >> .dockerignore
- name: Build and push images
env:
COMMIT_SHA_TAG: development-${{ github.sha }}
LATEST_DEV_TAG: dev-latest
run: |
docker build . -f web/flat-web/deploy/Dockerfile -t agoraflat/flat-web:$COMMIT_SHA_TAG -t agoraflat/flat-web:$LATEST_DEV_TAG
docker push agoraflat/flat-web:$COMMIT_SHA_TAG
docker push agoraflat/flat-web:$LATEST_DEV_TAG
- name: Prep helm chart
run: |
export APPVERSION=development-${{ github.sha }}
export CHART=./web/flat-web/helm/Chart.yaml
sed -i "s/^appVersion:.*$/appVersion: $APPVERSION/" $CHART
- name: Deploy
uses: WyriHaximus/github-action-helm3@v2
with:
exec: helm upgrade flat-web ./web/flat-web/helm --install --wait --atomic --namespace=default
kubeconfig: '${{ secrets.KUBECONFIG }}'