Skip to content

Deploy to Cloudflare Workers #7

Deploy to Cloudflare Workers

Deploy to Cloudflare Workers #7

Workflow file for this run

name: Deploy to Cloudflare Workers
on:
schedule:
- cron: "30 10 * * 2"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: ./import-geoip.sh
env:
MAXMIND_ACCOUNT_ID : ${{ secrets.MAXMIND_ACCOUNT_ID }}
MAXMIND_LICENSE_KEY : ${{ secrets.MAXMIND_LICENSE_KEY }}
CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
- run: mv tmp/wrangler.toml .
- run: npm run deploy
env:
CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Update release
run: |
mkdir release && cd release
DATE=`date`
echo $DATE >release
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b release
git add -A
git commit -m "$DATE"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin release