Skip to content

Commit

Permalink
fix: builder on deno deploy (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter authored Dec 16, 2024
1 parent ff573c5 commit 7a03e8f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 366 deletions.
11 changes: 11 additions & 0 deletions .github/tools/github_actions_deno_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
import * as JSONC from "@std/jsonc"
import * as core from "@actions/core"

// Ensure script is run in CI environment
if (!Deno.env.get("CI")) {
throw new Error("This script should be run only in CI environment")
}

// Remove lockfiles and package.json to avoid resolution conflicts
// https://github.com/denoland/deno/issues/27380
await Deno.remove("deno.lock", { recursive: true })
await Deno.remove("package.json", { recursive: true })
await Deno.remove("package-lock.json", { recursive: true })

// Parse deno.jsonc and print deno deploy flags
// deno-lint-ignore no-explicit-any
const config = JSONC.parse(await Deno.readTextFile("./deno.jsonc")) as any
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
- name: Run deno task deploy:setup-github-actions
run: deno task deploy:setup-github-actions
id: setup_github_actions
- run: deno install
- uses: denoland/deployctl@v1
with:
project: ${{ steps.setup_github_actions.outputs.project }}
Expand Down
8 changes: 3 additions & 5 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
// Deployment tasks
"deploy:setup-github-actions": {
"description": "",
"command": "deno run --allow-env --allow-read --allow-write=.imports_map.json,/home/runner/work/_temp .github/tools/github_actions_deno_deploy.ts",
"command": "deno run --allow-env --allow-read --allow-write=.imports_map.json,deno.lock,package.json,package-lock.json,/home/runner/work/_temp .github/tools/github_actions_deno_deploy.ts",
"dependencies": ["build"]
},
"deploy:preview": {
Expand Down Expand Up @@ -251,10 +251,8 @@
"www/.pages/**",
"www/api/**",
"www/*.ts",
"**/deno.jsonc"
// "deno.lock",
// "package.json",
// "package-lock.json"
"**/deno.jsonc",
"deno.lock"
],
"exclude": [
"@mizu/**/*.html",
Expand Down
Loading

0 comments on commit 7a03e8f

Please sign in to comment.