From 75fb393b0a7d52bfb4dd0121a9342a4f0fd03391 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Tue, 13 Oct 2020 12:05:31 -0400 Subject: [PATCH] deploy worker the "right" way (via wrangler) --- .github/workflows/deploy.yml | 12 ++++-------- .gitignore | 8 ++++++++ .npmrc | 1 + package.json | 28 ++++++++++++++++++++++++++++ wrangler.toml | 8 ++++++++ 5 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 package.json create mode 100644 wrangler.toml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7f23d35..80e4dd3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,11 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: jakejarvis/cloudflare-worker-action@master - env: - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - CLOUDFLARE_AUTH_EMAIL: ${{ secrets.CLOUDFLARE_AUTH_EMAIL }} - CLOUDFLARE_AUTH_KEY: ${{ secrets.CLOUDFLARE_AUTH_KEY }} - CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} - CLOUDFLARE_WORKER_NAME: 'simpip' - CLOUDFLARE_SCRIPT_NAME: 'index' + - uses: cloudflare/wrangler-action@1.3.0 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + environment: 'production' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..83be9f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +vendor/ +.env* +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +*.log diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/package.json b/package.json new file mode 100644 index 0000000..f627998 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "simpip", + "version": "1.0.0", + "description": "A very simple web server that returns your IP address in plaintext...and literally nothing else.", + "license": "MIT", + "homepage": "https://simpip.com/", + "author": { + "name": "Jake Jarvis", + "email": "jake@jarv.is", + "url": "https://jarv.is/" + }, + "main": "index.js", + "scripts": { + "start": "cloudworker index.js", + "publish": "wrangler publish --env production" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jakejarvis/simpip.git" + }, + "bugs": { + "url": "https://github.com/jakejarvis/simpip/issues" + }, + "devDependencies": { + "@cloudflare/wrangler": "^1.11.0", + "@dollarshaveclub/cloudworker": "^0.1.2" + } +} diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..f4b53c1 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,8 @@ +name = "simpip" +type = "javascript" +account_id = "bd1a636a30a817137ce1e91c9e407373" +workers_dev = true + +[env.production] +zone_id = "01417e1ce40cd6425a9ff87225bbd63a" +route = "simpip.com/*"