update chatbot #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: to node | |
on: | |
push: | |
branches: [ "feature-ui" ] | |
tags: | |
- '*' | |
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:local | |
yarn export | |
- name: Rename and zip Export | |
run: | | |
mkdir cdn | |
cp -r out/* cdn/ | |
mv out dashboard | |
cd dashboard | |
mkdir chatbot-ui | |
mv index.html chatbot-ui | |
mv favicon.png chatbot-ui | |
cd ../ | |
mv public/dashboard/index.html dashboard | |
tar czvf dashboard.tar.gz dashboard | |
- name: Commit changes | |
run: | | |
git config --local user.email "juyichen0413@foxmail.com" | |
git config --local user.name "JYC0413" | |
git add . | |
git commit -m "upload cdn files" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dashboard.tar.gz | |
asset_name: dashboard.tar.gz | |
asset_content_type: application/zip |