-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (52 loc) · 1.66 KB
/
exportAndPush.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
name: Release
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Install Dependencies
run: yarn
- name: Build Project
run: |
yarn build
yarn next export
- name: Clone target repository
run: git clone https://github.com/GaiaNet-AI/gaianet-node.git
- name: Copy build files
run: |
cd gaianet-node
cp -r ../out/* ./dashboard/chatbot-ui
cd ./dashboard/chatbot-ui
mv index.html ./chatbot-ui/index.html
echo '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta charset="UTF-8"><meta http-equiv="refresh" content="0; URL=/chatbot-ui/index.html"><title>Redirecting...</title></head><body></body></html>' > index.html
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd gaianet-node
git remote set-url --push origin https://JYC0413:$GITHUB_TOKEN@github.com/GaiaNet-AI/gaianet-node.git
git config --local user.email "juyichen0413@foxmail.com"
git config --global user.name "JYC0413"
git add .
git commit -m "Build and deploy chatbot-ui"
git push