From 16328ed6b6d224fc5e7047a98732cead66fa425e Mon Sep 17 00:00:00 2001 From: milankomaj Date: Wed, 14 Feb 2024 15:31:17 +0100 Subject: [PATCH] --- .github/workflows/deploy.yml | 30 ++++++++++++------------------ package.json | 20 ++++++++++---------- wrangler.toml | 17 +++++------------ 3 files changed, 27 insertions(+), 40 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 34e95e6..a582bbb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,34 +13,28 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v1 with: - node-version: '16' + node-version: '12' + - run: apt-fast update && apt-fast install -y jq - run: yarn install - - run: yarn kv-gc - run: yarn build - #- 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") + - 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: | - #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@v4 + - uses: actions/checkout@v3 - name: Timestamp shell: bash run: | diff --git a/package.json b/package.json index 9398479..8cf45c2 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.mjs", + "kv-gc": "node ./src/cli/gcMonitors.js", "format": "prettier --write '**/*.{js,css,json,md}'", "css": "postcss public/tailwind.css -o public/style.css" }, "dependencies": { - "flareact": "^1.5.0", + "flareact": "^0.10.0", "laco": "^1.2.1", "laco-react": "^1.1.0", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "react": "^17.0.1", + "react-dom": "^17.0.1" }, "devDependencies": { - "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", + "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", "yaml-loader": "^0.6.0" } } diff --git a/wrangler.toml b/wrangler.toml index a2178c6..927a101 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,22 +1,15 @@ name = "status" -compatibility_date = "2022-04-05" -#account_id = "" workers_dev = true -main = "./index.js" +account_id = "" +type = "webpack" +webpack_config = "node_modules/flareact/webpack" +compatibility_date = "2021-07-23" kv_namespaces = [{binding="KV_STATUS_PAGE", id="f0d41ec3d6f545188d33f201fd6680a7", preview_id="f0d41ec3d6f545188d33f201fd6680a7"}] -[build] -command = "npm run build" [triggers] crons = ["*/10 * * * *"] [site] bucket = "out" -#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" +entry-point = "./"