From 08d880214f466def72deaf321147d57fbe6f166f Mon Sep 17 00:00:00 2001 From: lino-levan <11367844+lino-levan@users.noreply.github.com> Date: Sat, 11 Mar 2023 19:52:15 -0800 Subject: [PATCH] feat: add guide on deploying to deno deploy --- src/lib/render.ts | 1 + www/pages/guides/deployment/deno-deploy.md | 48 +++++++++++++++++++++ www/pages/guides/deployment/github-pages.md | 8 ---- 3 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 www/pages/guides/deployment/deno-deploy.md delete mode 100644 www/pages/guides/deployment/github-pages.md diff --git a/src/lib/render.ts b/src/lib/render.ts index 3ccadb6..d2ea40f 100644 --- a/src/lib/render.ts +++ b/src/lib/render.ts @@ -7,6 +7,7 @@ import type { Config } from "./types.ts"; import "https://esm.sh/prismjs@1.29.0/components/prism-json?no-check"; import "https://esm.sh/prismjs@1.29.0/components/prism-bash?no-check"; +import "https://esm.sh/prismjs@1.29.0/components/prism-yaml?no-check"; export function render(config: Config, path: string) { const markdown = resolve_file(resolve("pages", path)); diff --git a/www/pages/guides/deployment/deno-deploy.md b/www/pages/guides/deployment/deno-deploy.md new file mode 100644 index 0000000..3d1a145 --- /dev/null +++ b/www/pages/guides/deployment/deno-deploy.md @@ -0,0 +1,48 @@ +--- +title: Deno Deploy +description: Pyro was designed from the ground up to be no-config and incredibly fast. +index: 0 +--- + +Pyro provides an easy way to publish to Deno Deploy using Github Actions, which +comes for free with every GitHub repository. + +Place the following file in `.github/workflows/deploy.yml` and replace +`DENO_DEPLOY_PROJECT` with the name of your project on Deno Deploy. + +```yaml +name: Deploy + +on: [push, pull_request] + +jobs: + deploy: + runs-on: ubuntu-latest + + permissions: + id-token: write # This is required to allow the GitHub Action to authenticate with Deno Deploy. + contents: read + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Download Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Install Pyro + run: deno install -Af --reload --config https://deno.land/x/pyro/deno.jsonc -n pyro https://deno.land/x/pyro/cli.ts + + - name: Build the website + working-directory: ./www + run: pyro build + + - name: Deploy to Deno Deploy + uses: denoland/deployctl@v1 + with: + project: DENO_DEPLOY_PROJECT + entrypoint: https://deno.land/std/http/file_server.ts + root: ./www/build +``` diff --git a/www/pages/guides/deployment/github-pages.md b/www/pages/guides/deployment/github-pages.md deleted file mode 100644 index fafce64..0000000 --- a/www/pages/guides/deployment/github-pages.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Github Pages -description: Pyro was designed from the ground up to be no-config and incredibly fast. -index: 0 ---- - -Pyro provides an easy way to publish to GitHub Pages, which comes for free with -every GitHub repository.