Update .gitea/workflows/deploy.yaml
Some checks failed
Deploy to Cloudflare Pages via API / deploy (push) Failing after 28m2s

This commit is contained in:
2025-10-28 01:31:31 +00:00
parent f88596fe2e
commit 5f56c63918

View File

@@ -7,10 +7,9 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: a98613a97af9b041d6a1ecd3d04f3007
PAGES_PROJECT_NAME: sample # Replace with your Pages project name
permissions:
contents: read
deployments: write
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -23,23 +22,11 @@ jobs:
- name: Build MkDocs
run: mkdocs build
- name: Install curl and zip
run: sudo apt install curl zip -y
- name: Create deployment archive
run: |
cd site # MkDocs output directory
zip -r ../deployment.zip . # Zip the built files
- name: Deploy to Cloudflare Pages
run: |
DEPLOY_RESPONSE=$(curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects/$PAGES_PROJECT_NAME/deployments" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-F "files=@deployment.zip" \
-F "manifest={\"site\": \"site\"}")
if echo "$DEPLOY_RESPONSE" | grep -q '"success":true'; then
echo "Deployment successful!"
else
echo "Deployment failed: $DEPLOY_RESPONSE"
exit 1
fi
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} # Or use email + apiKey if preferred
accountId: a98613a97af9b041d6a1ecd3d04f3007
projectName: sample
directory: site # MkDocs output directory
gitHubToken: ${{ secrets.GITHUB_TOKEN }} # Automatically provided