From ddabde15b6ad0d80597a8e43e272e3e6bddc17e8 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Mon, 8 Jan 2024 20:51:08 +0100 Subject: [PATCH 1/6] Try adding netlify edge workers --- .github/workflows/release.yml | 13 +++++++++++++ package.json | 1 + 2 files changed, 14 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb7e367..23fdd53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,9 @@ jobs: - name: Build for AWS run: pnpm build:aws && cd .output/server && zip -r ../../lambda.zip . + - name: Build for Netlify edge + run: pnpm build:netlify && cd .output/server && zip -r ../../netlify.zip . + - name: Build for Node run: pnpm build:node && cd .output/server && zip -r ../../nodejs.zip . @@ -70,6 +73,16 @@ jobs: asset_name: simple-proxy-aws-lambda.zip asset_content_type: application/zip + - name: Upload Netlify build + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./netlify.zip + asset_name: simple-proxy-netlify-edge.zip + asset_content_type: application/zip + - name: Upload Node build uses: actions/upload-release-asset@v1 env: diff --git a/package.json b/package.json index f44679c..8346524 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "build:cloudflare": "NITRO_PRESET=cloudflare npm run build", "build:aws": "NITRO_PRESET=aws_lambda npm run build", "build:node": "NITRO_PRESET=node-server npm run build", + "build:netlify": "NITRO_PRESET=netlify_edge npm run build", "start": "node .output/server/index.mjs", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", From 610ac5db2c3b14b98e833322034277a860cfd15c Mon Sep 17 00:00:00 2001 From: mrjvs Date: Mon, 8 Jan 2024 21:28:22 +0100 Subject: [PATCH 2/6] add netlify support --- .gitignore | 3 ++- netlify.toml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 netlify.toml diff --git a/.gitignore b/.gitignore index eee04ce..2ed8a07 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ node_modules .cache .output .env -dist \ No newline at end of file +dist +.netlify diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..5918f0a --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] +command = "pnpm build:netlify" +publish = "." From d907fa36f25ecb1eb4d09538d0f7ac5112629184 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Mon, 8 Jan 2024 21:29:42 +0100 Subject: [PATCH 3/6] test commit --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index 5918f0a..54c4db7 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,4 @@ [build] command = "pnpm build:netlify" publish = "." + From 2b77df66ecbf208a1aa9af6fdd2f81ed4d4e30b7 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Mon, 8 Jan 2024 21:38:27 +0100 Subject: [PATCH 4/6] Add netlify to readme --- README.md | 3 +++ netlify.toml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fd4538..3a99315 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,6 @@ Read the docs at https://docs.movie-web.app/proxy/introduction - cloudflare workers - AWS lambda - nodejs + - netlify edge functions + +[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/movie-web/simple-proxy) diff --git a/netlify.toml b/netlify.toml index 54c4db7..a413a57 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,4 +1,4 @@ [build] command = "pnpm build:netlify" publish = "." - +edge_functions = ".netlify" From 259b7bf1f755a27b8e7b3ccc8db51274db73cda1 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Mon, 8 Jan 2024 21:41:43 +0100 Subject: [PATCH 5/6] Remove deploy to netlify from readme --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 3a99315..e5fee27 100644 --- a/README.md +++ b/README.md @@ -19,5 +19,3 @@ Read the docs at https://docs.movie-web.app/proxy/introduction - AWS lambda - nodejs - netlify edge functions - -[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/movie-web/simple-proxy) From de07b4882bf10d085852cc7207c351e7a72b19e4 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Mon, 8 Jan 2024 21:43:08 +0100 Subject: [PATCH 6/6] remove netlify build from release, since it can only be used from git workflow anyway --- .github/workflows/release.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23fdd53..fb7e367 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,9 +31,6 @@ jobs: - name: Build for AWS run: pnpm build:aws && cd .output/server && zip -r ../../lambda.zip . - - name: Build for Netlify edge - run: pnpm build:netlify && cd .output/server && zip -r ../../netlify.zip . - - name: Build for Node run: pnpm build:node && cd .output/server && zip -r ../../nodejs.zip . @@ -73,16 +70,6 @@ jobs: asset_name: simple-proxy-aws-lambda.zip asset_content_type: application/zip - - name: Upload Netlify build - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./netlify.zip - asset_name: simple-proxy-netlify-edge.zip - asset_content_type: application/zip - - name: Upload Node build uses: actions/upload-release-asset@v1 env: