Skip to content

Build and push to CloudFlare Worker #28

Build and push to CloudFlare Worker

Build and push to CloudFlare Worker #28

name: Build and push to CloudFlare Worker
on:
workflow_dispatch:
jobs:
build:
name: Spellcheck
runs-on: ubuntu-latest
steps:
# The checkout step
- name: Checkout
uses: actions/checkout@v4
- name: Download _worker.js
run: |
curl -o _worker.js https://raw.githubusercontent.com/cmliu/CF-Workers-docker.io/main/_worker.js
- name: Set compatibility date
id: set-date
run: echo "COMPATIBILITY_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- name: Deploy to cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.EDIT_CLOUDFLARE_WORKERS }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy _worker.js --name dockerhub --compatibility-date ${{ env.COMPATIBILITY_DATE }}