diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7f6b2e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: Build +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install dependencies + run: | + npm i -g pnpm + pnpm i + + - name: Build + run: pnpm run build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: .vitepress/dist + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.gitignore b/.gitignore index 6620c81..f187d8e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules pnpm-lock.yaml .vitepress/cache +.vitepress/dist