Skip to content

Deploy to Cloudflare Pages #222

Deploy to Cloudflare Pages

Deploy to Cloudflare Pages #222

name: Deploy to Cloudflare Pages
on:
workflow_run:
workflows: ["Build"]
types:
- completed
jobs:
get-default-branch:
runs-on: ubuntu-latest
outputs:
isDefault: ${{ steps.check.outputs.isDefault }}
steps:
- name: Check if current branch is default
id: check
run: |
DEFAULT_BRANCH=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }} | jq -r '.default_branch')
IS_DEFAULT=false
if [ "$DEFAULT_BRANCH" = "${{ github.ref }}" ]; then
IS_DEFAULT=true
fi
echo "::set-output name=isDefault::$IS_DEFAULT"
deploy-to-cloudflare:
name: Deploy to Cloudflare Pages
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ubiquity/.github/.github/workflows/deploy.yml@main
with:
deploy_preview_branches: ${{ needs.get-default-branch.outputs.isDefault }}

Check failure on line 30 in .github/workflows/continuous-deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy to Cloudflare Pages

Invalid workflow file

The workflow is not valid. .github/workflows/continuous-deploy.yml (Line: 30, Col: 32): Invalid input, deploy_preview_branches is not defined in the referenced workflow.
permissions:
contents: read
pull-requests: write
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}