From 3c05ac451bf0bfcc63f3bd36ef160df511299a42 Mon Sep 17 00:00:00 2001 From: milankomaj Date: Wed, 14 Feb 2024 15:53:40 +0100 Subject: [PATCH] --- .github/workflows/deploy.yml | 30 ++++++++++++++++++------------ package.json | 20 ++++++++++---------- wrangler.toml | 17 ++++++++++++----- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a582bbb..34e95e6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,28 +13,34 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: '12' - - run: apt-fast update && apt-fast install -y jq + node-version: '16' - run: yarn install + - run: yarn kv-gc - run: yarn build - - name: Publish - uses: cloudflare/wrangler-action@1.3.0 - with: - apiToken: ${{ secrets.CF_API_TOKEN }} - preCommands: | - export KV_NAMESPACE_ID=$(npx @cloudflare/wrangler@1 kv:namespace list 2> >(tee stderr.log >&2) | head -1 | node -pe "JSON.parse(fs.readFileSync('/dev/stdin').toString()).find(kv => kv.title.includes('KV_STATUS_PAGE')).id") - postCommands: | + #- name: Publish + #uses: cloudflare/wrangler-action@2.0.0 + #with: + #apiToken: ${{ secrets.CF_API_TOKEN }} + #preCommands: | + #apt-get update && apt-get install -y jq + #export KV_NAMESPACE_ID=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq -r ".[0].id") + #namespace_id=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("__status-workers_sites_assets")))' | jq -r ".[0].id") + #postCommands: | + #yarn kv-gc env: CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} + KV_NAMESPACE_ID: ${{ secrets.KV_NAMESPACE_ID }} + CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} timestamp: runs-on: ubuntu-latest needs: deploy steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Timestamp shell: bash run: | diff --git a/package.json b/package.json index 8cf45c2..9398479 100644 --- a/package.json +++ b/package.json @@ -9,24 +9,24 @@ "dev": "flareact dev", "build": "yarn css && flareact build", "deploy": "yarn build && flareact publish", - "kv-gc": "node ./src/cli/gcMonitors.js", + "kv-gc": "node ./src/cli/gcMonitors.mjs", "format": "prettier --write '**/*.{js,css,json,md}'", "css": "postcss public/tailwind.css -o public/style.css" }, "dependencies": { - "flareact": "^0.10.0", + "flareact": "^1.5.0", "laco": "^1.2.1", "laco-react": "^1.1.0", - "react": "^17.0.1", - "react-dom": "^17.0.1" + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "devDependencies": { - "autoprefixer": "^10.0.2", - "node-fetch": "^2.6.1", - "postcss": "^8.2.10", - "postcss-cli": "^8.3.0", - "prettier": "^2.2.0", - "tailwindcss": "^2.0.1", + "autoprefixer": "^10.4.14", + "node-fetch": "^3.3.1", + "postcss": "^8.4.23", + "postcss-cli": "^10.1.0", + "prettier": "^3.0.3", + "tailwindcss": "^3.3.2", "yaml-loader": "^0.6.0" } } diff --git a/wrangler.toml b/wrangler.toml index 927a101..a2178c6 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,15 +1,22 @@ name = "status" +compatibility_date = "2022-04-05" +#account_id = "" workers_dev = true -account_id = "" -type = "webpack" -webpack_config = "node_modules/flareact/webpack" -compatibility_date = "2021-07-23" +main = "./index.js" kv_namespaces = [{binding="KV_STATUS_PAGE", id="f0d41ec3d6f545188d33f201fd6680a7", preview_id="f0d41ec3d6f545188d33f201fd6680a7"}] +[build] +command = "npm run build" [triggers] crons = ["*/10 * * * *"] [site] bucket = "out" -entry-point = "./" +#entry-point = "./" + +# uncomment and adjust following if you are not using GitHub Actions +#[env.production] +#kv-namespaces = [{binding="KV_STATUS_PAGE", id="xxxx", preview_id=""}] +#zone_id="xxx" +#route="xxx"