diff --git a/.drone.yml b/.drone.yml index 04ea97a..9dfd9b5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,11 +3,6 @@ type: docker name: example pipeline steps: - - name: Build site - image: denoland/deno:alpine - commands: - - deno run -A https://deno.land/x/lume/ci.ts - - name: Staging image: git.froth.zone/sam/drone-deno-deploy environment: @@ -20,21 +15,7 @@ steps: event: - pull_request depends_on: - - "Build site" - # - name: Comment on PR - # image: tsakidev/giteacomment:latest - # settings: - # gitea_token: - # from_secret: gitea_token - # gitea_base_url: https://git.froth.zone - # comment_title: "Deno Deploy URL" - # comment_from_file: "/url" - # depends_on: - # - "Staging" - # when: - # event: - # - pull_request - + - "Clone" - name: Deploy to Deno Deploy (prod) image: git.froth.zone/sam/drone-deno-deploy environment: @@ -45,7 +26,7 @@ steps: entrypoint: server/main.ts production: true depends_on: - - "Build site" + - "Clone" when: branch: - master diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..eeb7df6 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,25 @@ +name: ci + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Deploy + uses: samtherapy/deno-deploy@master + with: + deno_deploy_token: ${{ secrets.DENO_DEPLOY_TOKEN }} + entrypoint: server/main.ts + project: github-actions-deploy + + \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d1f5ec6..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "request": "launch", - "type": "pwa-node", - "program": "https:/deno.land/x/lume@v1.5.1/cli.ts", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "deno", - "runtimeArgs": [ - "run", - "--unstable", - "--import-map=.vscode/lume_import_map.json", - "--inspect", - "--allow-all" - ], - "attachSimplePort": 9229, - "name": "Lume build" - }, - { - "request": "launch", - "type": "pwa-node", - "program": "https:/deno.land/x/lume@v1.5.1/cli.ts", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "deno", - "runtimeArgs": [ - "run", - "--unstable", - "--import-map=.vscode/lume_import_map.json", - "--inspect", - "--allow-all" - ], - "attachSimplePort": 9229, - "name": "Lume serve", - "args": [ - "--serve" - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 27ec43b..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "deno.enable": true, - "deno.lint": true, - "deno.unstable": true, - "deno.suggest.imports.hosts": { - "https://deno.land": true - } -} diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..2f64fa8 --- /dev/null +++ b/deno.json @@ -0,0 +1,10 @@ +{ + "deploy": { + "project": "40dfd057-d475-4171-b26e-03d6649edd5e", + "exclude": [ + "**/node_modules" + ], + "include": [], + "entrypoint": "server/main.ts" + } +} \ No newline at end of file diff --git a/index.njk b/index.html similarity index 57% rename from index.njk rename to index.html index a73ab95..c3a672a 100644 --- a/index.njk +++ b/index.html @@ -1,14 +1,13 @@ ---- -title: Welcome to my page ---- + - {{ title }} + Welcome to my page + -

{{ title }}

-

This is an example of a static site generated by Lume on Deno Deploy.

+

Welcome to my page

+

This is an example of a static site generated on Deno Deploy.

The /api/time endpoint dynamically returns the current time.

You can find the source code for this site on my Gitea instance.

diff --git a/server/main.ts b/server/main.ts index bfb3f66..3786b4b 100644 --- a/server/main.ts +++ b/server/main.ts @@ -7,7 +7,7 @@ const app = new Application(); app.use(async (ctx, next) => { try { await ctx.send({ - root: `${Deno.cwd()}/_site`, + root: `${Deno.cwd()}`, index: "index.html", }); } catch {