From 3fb4ddeeba7ab71b1194d95ff3826600bf210a3d Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Sat, 1 Jun 2024 23:34:44 +0900 Subject: [PATCH] Stop using doc branch to use github pages fix workflow miss --- .github/workflows/deploy-doc.yml | 50 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 36 ++--------------------- 2 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/deploy-doc.yml diff --git a/.github/workflows/deploy-doc.yml b/.github/workflows/deploy-doc.yml new file mode 100644 index 000000000..848e298a0 --- /dev/null +++ b/.github/workflows/deploy-doc.yml @@ -0,0 +1,50 @@ +name: Deploy static content to Pages on release + +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Install dependencies + run: npm ci + + - name: Build API Docs + run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs + - name: Build Docs + run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: [build] + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 763033fff..6dcab00f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,37 +26,5 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} deploy-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Install Dependency - run: npm ci - - name: Config Internal Git - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - - name: Clone Doc History - uses: actions/checkout@v4 - with: - ref: 'gh-pages' - path: 'doc-dist' - - name: Clean Doc Directory - run: | - cd doc-dist - ls | grep -v '.git' | xargs rm -r - cd ../ - - name: Build API Docs - run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs - - name: Build Docs - run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build - - name: Copy & Deploy - run: | - cp -r docs/.vitepress/dist/* doc-dist/ - cd doc-dist - git add -A - git commit -m 'Deploy docs' - git push + needs: [release-package] + use: ./.github/workflows/deploy-doc.yml