websoft9/.github/workflows/dockerhub_proxy.yml
2024-10-23 14:00:17 +08:00

28 lines
858 B
YAML

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 }}