chenglu / actions-cloudflare-pages

Github Action for deploying to Cloudflare pages when needed.

Home Page:https://github.com/marketplace/actions/cloudflare-page-deploy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloudflare Page Deploy

A Github Action that triggers a deployment with Cloudflare Pages. Useful to have more control on when deployments are triggered with Cloudflare.

Configuration

All senstive information like account, email and global token should be stored with encrypted secrets

Account ID

Your account ID will be on the bottom right of the overview page for your domain.

Image of blurred out account ID

Setting up Authentication

Currently, the only way to authicate with pages is using global authication.

  1. Log in to Cloudflare and go to My Profile -> API Tokens -> Global API Key
  2. You will need to enter your password to get the key.
  3. Copy that key into a secret on Github and you will be able to use it.

Example workflow

name: Deploy Site
on: push

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:

    # Put steps here to build, and check your site.

    - name: Clear Cloudflare cache
      uses: Cyb3r-Jak3/actions-cloudflare-pages@<Latest Release>
      with:
        account: ${{ secrets.CLOUDFLARE_ZONE }}
        project: ${{ secrets.CLOUDFLARE_PROJECT }}
        email: ${{ secrets.CLOUDFLARE_EMAIL }}
        global_token: ${{ secrets.CLOUDFLARE_KEY }}

Keep up-to-date with GitHub Dependabot

Since Dependabot has native GitHub Actions support, to enable it on your GitHub repo all you need to do is add the .github/dependabot.yml file:

version: 2
updates:
  # Maintain dependencies for GitHub Actions
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly

About

Github Action for deploying to Cloudflare pages when needed.

https://github.com/marketplace/actions/cloudflare-page-deploy

License:Mozilla Public License 2.0


Languages

Language:TypeScript 78.6%Language:Dockerfile 16.7%Language:JavaScript 4.7%