refactor: better layout #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Poller | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "poller/**" | |
- ".github/workflows/deployPoller.yml" | |
repository_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: yarn install | |
- run: yarn build | |
working-directory: poller | |
- name: Publish | |
uses: cloudflare/[email protected] | |
with: | |
workingDirectory: poller | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
preCommands: | | |
wrangler kv:namespace create KV_STATUS_PAGE || true | |
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") | |
echo "[env.production]" >> wrangler.toml | |
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=\"${KV_NAMESPACE_ID}\"}]" >> wrangler.toml | |
postCommands: | | |
yarn kv-gc | |
environment: production | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
YARN_IGNORE_NODE: 1 |