-
Notifications
You must be signed in to change notification settings - Fork 76
97 lines (85 loc) · 3.14 KB
/
dubboctl-ui-update.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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Dubboctl UI Update
on:
workflow_dispatch:
push:
branches:
- master
paths:
- .github/workflows/dubboctl-ui-update.yaml
- ui-vue3/**
# Trigger the workflow when a pull request is opened or updated.
# This is to make sure the build process would not be broken by the
# changes in the pull request.
pull_request:
branches:
- master
paths:
- .github/workflows/dubboctl-ui-update.yaml
- ui-vue3/**
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui-vue3
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: "ui-vue3/.nvmrc"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Lint
run: |
# disable eslint for now as the new ui is under heavy development
# when the new ui is ready, we can enable eslint again (please also update the .lintstagedrc.json file)
# yarn lint
yarn prettier-check
update-ui:
runs-on: ubuntu-latest
if: github.repository == 'apache/dubbo-kubernetes'
defaults:
run:
working-directory: ui-vue3
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: "ui-vue3/.nvmrc"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run Dubboctl UI build
run: yarn build
- name: Move build artifacts
run: |
rm -rf ../app/dubbo-ui/dist/
mv dist/ ../app/dubbo-ui/dist/
- name: Create PR if the build is changed
# This step will be skipped if the workflow is triggered by a pull request.
# As the build asset should only be updated when the main branch is updated.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[Dubboctl UI] Update build artifacts\n\nBuild commit: ${{ github.sha }}"
title: "[Dubboctl UI] Update build artifacts"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
body: "Dubboctl UI auto build commit: ${{ github.sha }}"
branch: github-actions/dubboctl-ui-update