From 4464c6a5311ddf6d3865477711f9c76da8bfa7f3 Mon Sep 17 00:00:00 2001 From: Lino Le Van <11367844+lino-levan@users.noreply.github.com> Date: Fri, 17 Mar 2023 11:59:37 -0700 Subject: [PATCH] docs: guide on publishing to github pages (#26) --- www/pages/guides/deployment/deno-deploy.md | 9 ++-- www/pages/guides/deployment/github-pages.md | 59 +++++++++++++++++++++ 2 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 www/pages/guides/deployment/github-pages.md diff --git a/www/pages/guides/deployment/deno-deploy.md b/www/pages/guides/deployment/deno-deploy.md index a2e1b36..96cc35a 100644 --- a/www/pages/guides/deployment/deno-deploy.md +++ b/www/pages/guides/deployment/deno-deploy.md @@ -13,7 +13,11 @@ Place the following file in `.github/workflows/deploy.yml` and replace ```yaml name: Deploy -on: [push, pull_request] +on: + push: + branches: [main] + pull_request: + branches: [main] jobs: deploy: @@ -36,7 +40,6 @@ jobs: run: deno run -Ar https://deno.land/x/pyro/install.ts - name: Build the website - working-directory: ./www run: pyro build - name: Deploy to Deno Deploy @@ -44,5 +47,5 @@ jobs: with: project: DENO_DEPLOY_PROJECT entrypoint: https://deno.land/std/http/file_server.ts - root: ./www/build + root: ./build ``` diff --git a/www/pages/guides/deployment/github-pages.md b/www/pages/guides/deployment/github-pages.md new file mode 100644 index 0000000..b55e581 --- /dev/null +++ b/www/pages/guides/deployment/github-pages.md @@ -0,0 +1,59 @@ +--- +title: Github Pages +description: Pyro was designed from the ground up to be no-config and incredibly fast. +index: 1 +--- + +Pyro provides an easy way to publish to Github Pages using Github Actions, which +comes for free with every GitHub repository. + +Place the following file in `.github/workflows/deploy.yml`. + +```yaml +name: Deploy + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + + permissions: + id-token: write + pages: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Install Pyro + run: deno run -Ar https://deno.land/x/pyro/install.ts + + - name: Build the website + run: pyro build + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: './build' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 +```