From e8e20579f37a326239de61b3ba3cf9fd29eab940 Mon Sep 17 00:00:00 2001 From: alexytomi <60690056+alexytomi@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:07:22 +0800 Subject: [PATCH] create working actions for building and deploying --- .github/workflows/build.yml | 25 +++++++++++-------------- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71ecdb26..cc63d94c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build/Test/Deploy +name: Build on: push: branches-ignore: @@ -7,26 +7,23 @@ on: pull_request: jobs: build: - name: Build and Deploy + name: Build and Upload runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v2-beta - with: - node-version: '12' - name: Checkout Repository uses: actions/checkout@v2 with: fetch-depth: '0' persist-credentials: false submodules: 'recursive' - - name: Install - run: npm install + - name: Setup Node + uses: actions/setup-node@v2-beta + with: + node-version: '12' - name: Build - run: npm run build - - name: Deploy - uses: JamesIves/github-pages-deploy-action@4.1.5 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}} + run: npm install && npm run build + - name: Upload Build + uses: actions/upload-pages-artifact@v3 with: - BRANCH: gh-pages - FOLDER: docs - CLEAN: true + path: docs + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..4f729bb5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Build and Deploy +on: + workflow_dispatch: +jobs: + build: + name: Build and Deploy + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: '0' + persist-credentials: false + submodules: 'recursive' + - name: Build + uses: actions/setup-node@v2-beta + with: + node-version: '12' + run: npm install && npm run build + deploy: + environment: + name: Deploy + url: ${{ steps.deployment.outputs.page_url }} + permissions: + contents: read + pages: write + id-token: write + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +