Skip to content

Commit

Permalink
Merge pull request #30 from movie-web/dev
Browse files Browse the repository at this point in the history
Netlify support but to master this time
  • Loading branch information
binaryoverload authored Jan 8, 2024
2 parents 5a09e0c + b25fc06 commit 0af2174
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 198 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- name: Install packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- name: Install packages
Expand All @@ -41,20 +41,34 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- name: Install pnpm packages
run: pnpm install --frozen-lockfile

- name: Build Project
run: pnpm build

docker:
name: Build docker
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/build-push-action@v5
13 changes: 8 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Get version
id: package-version
uses: martinbeentjes/npm-get-version-action@main

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -47,9 +47,12 @@ jobs:
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm
context: .
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.current-version }}
release_name: Bot v${{ steps.package-version.outputs.current-version }}
release_name: Simple-proxy v${{ steps.package-version.outputs.current-version }}
draft: false
prerelease: false
body: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
.cache
.output
.env
dist
dist
.netlify
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine as base
FROM node:20-alpine as base
WORKDIR /app

# Build layer
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# simple-proxy

Simple reverse proxy to bypass CORS, used by [movie-web](https://movie-web.app).
Read the docs at https://docs.movie-web.app/proxy
Read the docs at https://docs.movie-web.app/proxy/introduction

---

Expand All @@ -18,3 +18,4 @@ Read the docs at https://docs.movie-web.app/proxy
- cloudflare workers
- AWS lambda
- nodejs
- netlify edge functions
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build]
command = "pnpm build:netlify"
publish = "."
edge_functions = ".netlify"
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "simple-proxy",
"private": true,
"version": "2.1.3",
"version": "2.1.4",
"scripts": {
"prepare": "nitropack prepare",
"dev": "nitropack dev",
"build": "nitropack build",
"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/",
Expand All @@ -26,6 +27,12 @@
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-prettier": "^5.0.0"
"eslint-plugin-prettier": "^5.0.0",
"@rollup/wasm-node": "^4.9.4"
},
"pnpm": {
"overrides": {
"rollup": "npm:@rollup/wasm-node"
}
}
}
Loading

0 comments on commit 0af2174

Please sign in to comment.