A Github Action that triggers a deployment with Cloudflare Pages. Useful to have more control on when deployments are triggered with Cloudflare.
All senstive information like account, email and global token should be stored with encrypted secrets
Your account ID will be on the bottom right of the overview page for your domain.
Currently, the only way to authicate with pages is using global authication.
- Log in to Cloudflare and go to My Profile -> API Tokens -> Global API Key
- You will need to enter your password to get the key.
- Copy that key into a secret on Github and you will be able to use it.
name: Deploy Site
on: push
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Put steps here to build, and check your site.
- name: Cloudflare pages build
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 }}
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