Skip to content

Merge pull request #220 from TBXark/dev #34

Merge pull request #220 from TBXark/dev

Merge pull request #220 from TBXark/dev #34

Workflow file for this run

name: Deploy to Cloudflare Workers
on:
push:
branches: [ "master" ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: touch wrangler.toml
- run: |
cat << 'EOF' > wrangler.toml
${{secrets.WRANGLER_TOML}}
EOF
- run: npm install
- run: CLOUDFLARE_API_TOKEN=${{ secrets.CF_API_TOKEN }} npm run wrangler publish --config=wrangler.toml > /dev/null
- name: Check CF_WORKERS_DOMAIN exists
run: |
url=${{ secrets.CF_WORKERS_DOMAIN }}
if [ -z "$url" ]; then
echo "CF_WORKERS_DOMAIL does not exist"
else
echo "CF_WORKERS_DOMAIN exists"
curl -s -o /dev/null https://$url/init
fi