-
Notifications
You must be signed in to change notification settings - Fork 450
99 lines (83 loc) · 2.78 KB
/
deploy_web.yaml
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
name: Deploy MQTTX Web
on:
release:
types:
- published
pull_request:
paths:
- 'apps/web/**'
- 'apps/packages/ui/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: |
pnpm install
- name: Write secret key to .env file
run: echo "VITE_WEB_DB_SECRET_KEY=${{ secrets.VITE_WEB_DB_SECRET_KEY }}" >> ./apps/web/.env
- name: Build
run: |
pnpm run build:web
# - name: upload dist
# if: github.event_name == 'release' && !github.event.release.prerelease
# run: |
# cd web
# wget https://gosspublic.alicdn.com/ossutil/1.7.8/ossutil64
# chmod 755 ./ossutil64
# ./ossutil64 config -e https://oss-accelerate.aliyuncs.com -i ${{ secrets.ALI_OSS_ACCESSKEY_ID }} -k ${{ secrets.ALI_OSS_ACCESSKEY_SECRET }} -L CH
# ./ossutil64 cp -r dist/ oss://emqx-io-docs/ -u
# publish_docker:
# if: github.event_name != 'pull_request'
# runs-on: ubuntu-20.04
# steps:
# - name: use node.js
# uses: actions/setup-node@v1
# with:
# node-version: 16.14
# - uses: actions/checkout@v3
# - name: set env
# run: |
# cd web
# echo "VUE_APP_PAGE_TITLE=Easy-to-Use Online MQTT Client | Try Now" > .env.local
# echo "VUE_APP_PAGE_DESCRIPTION=Online MQTT 5.0 client on the web, using MQTT over WebSocket to connect to the MQTT Broker and test message publishing and receiving in the browser." >> .env.local
# - name: build
# run: |
# cd web
# yarn && yarn build:docker
# - name: docker meta
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: emqx/mqttx-web
# flavor: |
# latest=${{ !github.event.release.prerelease }}
# tags: |
# type=ref,event=tag
# - name: set up qemu
# uses: docker/setup-qemu-action@v2
# - name: set up docker buildx
# uses: docker/setup-buildx-action@v2
# - name: login to docker hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_USER }}
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
# - name: build and push
# uses: docker/build-push-action@v3
# with:
# context: ./web
# push: true
# platforms: linux/amd64,linux/arm64
# tags: ${{ steps.meta.outputs.tags }}