From 6fb5709de11d5e85d66c73cf37e74105f6f757c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Tue, 12 Mar 2024 15:59:21 +0800 Subject: [PATCH] ci: deploy docs --- .github/workflows/gh-pages.yml | 53 ++++++++++++++++++++++++++++++++++ docs/CNAME | 1 - eslint.config.js | 2 ++ netlify.toml | 3 -- 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/gh-pages.yml delete mode 100644 docs/CNAME delete mode 100644 netlify.toml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..72b27ec7 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,53 @@ +name: Github Page Docs +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set node + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Build unplugin + run: nr build + + - name: Build docs + run: nr docs:build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs/.vitepress/dist + + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages 🚀 + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 5811c237..00000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -unplugin.unjs.io \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js index 2159edfc..68c09e52 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,6 +6,8 @@ module.exports = antfu( ignores: [ 'test-out/**', '**/output.js', + 'docs/showcase/*.md', + 'docs/.vitepress/data/repository.json', ], }, { diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 70cca052..00000000 --- a/netlify.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build] -command = "pnpm build && pnpm docs:build" -publish = "docs/dist"