1
0
mirror of https://github.com/tormachris/cf-workers-status-page.git synced 2025-07-05 03:22:47 +02:00

feat: move gc monitors from cron schedule to deploy postCommands

This commit is contained in:
Adam Janis
2020-11-18 21:01:56 +01:00
parent 126a48b5cb
commit fe1b63424d
7 changed files with 105 additions and 35 deletions

View File

@ -24,10 +24,12 @@ jobs:
preCommands: |
wrangler kv:namespace create KV_STATUS_PAGE
apt-get update && apt-get install -y jq
kv_namespace_id=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq ".[0].id")
export KV_NAMESPACE_ID=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq -r ".[0].id")
echo "[env.production]" >> wrangler.toml
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=${kv_namespace_id}}]" >> wrangler.toml
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=\"${KV_NAMESPACE_ID}\"}]" >> wrangler.toml
[ -z "$SECRET_SLACK_WEBHOOK_URL" ] && echo "Secret SECRET_SLACK_WEBHOOK_URL not set, creating dummy one..." && SECRET_SLACK_WEBHOOK_URL="default-gh-action-secret" || true
postCommands: |
yarn kv-gc
secrets: |
SECRET_SLACK_WEBHOOK_URL
environment: production