The output dist directory can be deployed to your server as a website. We strongly recommend to use CI to automate the deployment process. Here are a few common deployment methods:

GitHub Pages§

GitHub Pages is the most common service for hosting static websites. Through the official CI tool GitHub Actions provided by GitHub, we can automatically build and deploy the website.

It is very simple to automatically build and deploy the website to GitHub Pages. You only need to create a .github/workflows/ci.yml file in your GitHub project with the following content:

name: gh-pages

      - master

    runs-on: ubuntu-18.04
      - uses: actions/checkout@v2

      - name: Setup deno
        uses: denolib/setup-deno@v2
          deno-version: v1.7.0

      - name: Build gh-pages
        run: |
          deno --version
          deno install --unstable --allow-read --allow-write --allow-net --allow-run --name=pagic
          pagic build

      - name: Deploy gh-pages
        uses: peaceiris/actions-gh-pages@v3
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./dist

Be sure to replace in the last line with your own domain.

If you don't have your own domain, you can also use the free domain provided by GitHub, just delete the last line. Note that you may need to modify the root configuration in pagic.config.ts to support sub-paths. For details, please refer to the Config chapter.


Create a file in the project root directory:


# Install deno
curl -fsSL | sh

# Install pagic
/vercel/.deno/bin/deno install --unstable --allow-read --allow-write --allow-net

# Pagic build
/vercel/.deno/bin/deno run --unstable --allow-read --allow-write --allow-net --allow-run build

Configure script command in package.json:

"scripts": {
+  "deploy:vercel": "sh"

Next, Complete the following steps on the vercel website:

  1. Home -- Overview -- Import Project

  2. Enter the URL of a git repository, Import git repository, click continue

  3. Configure project information

    • Enter project name, framework preset defaults to Other
    • Build and Output Settings, Build Command: npm run deploy:vercel Output Directory: dist (You can also fill in your own configuration)
  4. Click Deploy,Wait for deployment to complete to visit 🎊