From 2b1b5cdc81ffacb2415db288e674a02c393ae707 Mon Sep 17 00:00:00 2001 From: JYC0413 Date: Mon, 6 May 2024 13:37:57 +0800 Subject: [PATCH] fix --- .github/workflows/exportAndPushToDApp.yml | 54 +++++++++++++++++++ ...ortAndPush.yml => exportAndPushToNode.yml} | 0 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/exportAndPushToDApp.yml rename .github/workflows/{exportAndPush.yml => exportAndPushToNode.yml} (100%) diff --git a/.github/workflows/exportAndPushToDApp.yml b/.github/workflows/exportAndPushToDApp.yml new file mode 100644 index 0000000..b185ebf --- /dev/null +++ b/.github/workflows/exportAndPushToDApp.yml @@ -0,0 +1,54 @@ +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-dapp.git + + - name: Copy build files + run: | + cd gaianet-dapp + mv ../out ./src/chatbot-ui + + - 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-dapp.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 \ No newline at end of file diff --git a/.github/workflows/exportAndPush.yml b/.github/workflows/exportAndPushToNode.yml similarity index 100% rename from .github/workflows/exportAndPush.yml rename to .github/workflows/exportAndPushToNode.yml