1
0
mirror of https://github.com/tormachris/cf-workers-status-page.git synced 2024-09-21 13:13:05 +02:00
cf-workers-status-page/.github/workflows/deploy.yml

36 lines
1.0 KiB
YAML
Raw Normal View History

2020-11-08 13:56:02 +01:00
name: Deploy
2020-11-13 23:00:53 +01:00
2020-11-08 13:56:02 +01:00
on:
2020-11-13 23:00:53 +01:00
push:
branches:
- main
repository_dispatch:
2020-11-08 13:56:02 +01:00
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn install
- run: yarn build
- name: Publish
2020-11-13 23:00:53 +01:00
uses: cloudflare/wrangler-action@1.3.0
2020-11-08 13:56:02 +01:00
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
2020-11-13 23:00:53 +01:00
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")
echo "[env.production]" >> wrangler.toml
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=${kv_namespace_id}}]" >> wrangler.toml
secrets: |
SECRET_SLACK_WEBHOOK_URL
environment: production
2020-11-08 13:56:02 +01:00
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
2020-11-13 23:00:53 +01:00
SECRET_SLACK_WEBHOOK_URL: ${{secrets.SECRET_SLACK_WEBHOOK_URL}}