Skip to content

Commit

Permalink
updated workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Toasty360 committed Nov 25, 2024
1 parent afb72dd commit 68cf49b
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,7 @@ jobs:
- name: Check Wrangler Version
run: wrangler --version

- name: Verify Secrets
run: |
if [ -z "${{ secrets.CLOUDFLARE_API_TOKEN }}" ]; then
echo "Error: CLOUDFLARE_API_TOKEN is not set."
exit 1
fi
if [ -z "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" ]; then
echo "Error: CLOUDFLARE_ACCOUNT_ID is not set."
exit 1
fi
- name: Upload Worker Version
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: versions upload
- name: Deploy Worker
env:
DEBUG: wrangler*

- name: Handle Missing Worker
if: failure()
run: |
echo "Worker not found or upload failed. Creating and publishing a new Worker."
npx wrangler publish
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: wrangler deploy

0 comments on commit 68cf49b

Please sign in to comment.