diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b496ae6..f58f0bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: ci -on: [push, pull_request] +on: + push: + branches: [main] + pull_request: + branches: [main] jobs: build: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a279999..b7f3a90 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,10 @@ name: Deploy -on: [push, pull_request] +on: + push: + branches: [main] + pull_request: + branches: [main] jobs: deploy: @@ -20,7 +24,7 @@ jobs: deno-version: v1.x - name: Install Pyro - run: deno install -Af --reload --config ./deno.jsonc -n pyro ./cli.ts + run: deno task install - name: Build the website working-directory: ./www diff --git a/deno.jsonc b/deno.jsonc index fb114ab..ad33db7 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,10 +1,10 @@ { "tasks": { - "install": "deno install -Af --reload --config ./deno.jsonc -n pyro ./cli.ts" + "install": "deno run -Ar install.ts ." }, "imports": { - "preact": "https://esm.sh/preact@10.11.0", - "preact/": "https://esm.sh/preact@10.11.0/", + "preact": "https://esm.sh/preact@10.13.1", + "preact/": "https://esm.sh/preact@10.13.1/", "preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.4", "std/": "https://deno.land/std@0.179.0/", "gfm": "https://deno.land/x/gfm@0.2.1/mod.ts", diff --git a/install.ts b/install.ts new file mode 100644 index 0000000..a8e4a51 --- /dev/null +++ b/install.ts @@ -0,0 +1,36 @@ +// I'm preemptively sorry about this install script. +// Deno has a bug where you can't --config from a remote +// location which makes it impossible afaik to do this +// another way. If you have a better idea, open a PR! + +let config_file = "./384y89xnd.jsonc"; +const install_from = Deno.args[0] ?? "https://deno.land/x/pyro"; + +if (install_from === ".") { + config_file = "./deno.jsonc"; +} else { + Deno.writeFileSync( + config_file, + new Uint8Array( + await (await fetch(install_from + "/deno.jsonc")).arrayBuffer(), + ), + ); +} + +const command = new Deno.Command(Deno.execPath(), { + args: [ + "install", + "-Afr", + "--config", + config_file, + "-n", + "pyro", + install_from + "/cli.ts", + ], +}); + +command.outputSync(); + +if (install_from !== ".") { + Deno.removeSync(config_file); +} diff --git a/www/pages/getting-started/installation.md b/www/pages/getting-started/installation.md index 11beecb..c186cb8 100644 --- a/www/pages/getting-started/installation.md +++ b/www/pages/getting-started/installation.md @@ -15,7 +15,7 @@ Pyro(raptor) is essentially just a [Deno CLI tool](https://deno.land). If these requirements are met, you should be able to install the CLI: ```bash -deno install -Af --reload --config https://deno.land/x/pyro/deno.jsonc -n pyro https://deno.land/x/pyro/cli.ts +deno run -Ar https://deno.land/x/pyro/install.ts ``` ## Scaffold your first site diff --git a/www/pages/guides/deployment/deno-deploy.md b/www/pages/guides/deployment/deno-deploy.md index 3d1a145..a2e1b36 100644 --- a/www/pages/guides/deployment/deno-deploy.md +++ b/www/pages/guides/deployment/deno-deploy.md @@ -33,7 +33,7 @@ jobs: 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 + run: deno run -Ar https://deno.land/x/pyro/install.ts - name: Build the website working-directory: ./www diff --git a/www/pages/index.md b/www/pages/index.md index fba43fa..9d93ddb 100644 --- a/www/pages/index.md +++ b/www/pages/index.md @@ -24,7 +24,7 @@ Understand Pyro in **5 minutes** by trying it out! First install Pyro ```bash -deno install -Af --reload --config https://deno.land/x/pyro/deno.jsonc -n pyro https://deno.land/x/pyro/cli.ts +deno run -Ar https://deno.land/x/pyro/install.ts ``` Create the site