Update dependency @types/fs-extra to v11.0.4 #614
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 Worker | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7 | |
- name: Install dependencies | |
run: | | |
pnpm install | |
pnpm i -g wrangler | |
sudo apt-get update && sudo apt-get install -y jq | |
- name: Publish | |
run: | | |
cd packages/status-worker/ | |
[ -z ${{secrets.SECRET_SLACK_WEBHOOK_URL}} ] && echo ${{secrets.SECRET_SLACK_WEBHOOK_URL}} | npx wrangler secret put "SECRET_SLACK_WEBHOOK_URL" | |
[ -z ${{secrets.SECRET_TELEGRAM_API_TOKEN}} ] && echo ${{secrets.SECRET_TELEGRAM_API_TOKEN}} | npx wrangler secret put "SECRET_TELEGRAM_API_TOKEN" | |
[ -z ${{secrets.SECRET_TELEGRAM_CHAT_ID}} ] && echo ${{secrets.SECRET_TELEGRAM_CHAT_ID}} | npx wrangler secret put "SECRET_TELEGRAM_CHAT_ID" | |
[ -z ${{secrets.SECRET_DISCORD_WEBHOOK_URL}} ] && echo ${{secrets.SECRET_DISCORD_WEBHOOK_URL}} | npx wrangler secret put "SECRET_DISCORD_WEBHOOK_URL" | |
export KV_NAMESPACE_STATUS=$(npx wrangler kv:namespace list | jq '.[] | select(.title=="KV_STATUS_PAGE") .id') | |
[ -z "$KV_NAMESPACE_STATUS" ] && npx wrangler kv:namespace create KV_STATUS_PAGE | |
[ -z "$KV_NAMESPACE_STATUS" ] && npx wrangler kv:namespace create KV_STATUS_PAGE --preview | |
export KV_NAMESPACE_ID=$(npx wrangler kv:namespace list | jq '.[] | select(.title=="KV_STATUS_PAGE") .id') | |
export KV_NAMESPACE_ID_PREVIEW=$(npx wrangler kv:namespace list | jq '.[] | select(.title=="KV_STATUS_PAGE_preview") .id') | |
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=${KV_NAMESPACE_ID}, preview_id=${KV_NAMESPACE_ID_PREVIEW}}]" >> wrangler.toml | |
echo "[triggers]" >> wrangler.toml | |
echo "crons = [\"*/5 * * * *\"]" >> wrangler.toml | |
wrangler publish | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} |