cloudflare-pages-slack-notification
cloudflare-pages-slack-notification copied to clipboard
GitHub Action for CloudFlare Pages Slack notifications
CloudFlare Pages Slack notification
Using CF Pages Await made by Daniel Walsh WalshyDev
Wait for Cloudflare Pages build to finish and send Slack notification
Recommended:
Generate API Token go to https://dash.cloudflare.com/profile/api-tokens
Create Custom Token

Usage
- name: Await CF Pages and send Slack notification
uses: arddluma/cloudflare-pages-slack-notification@v4
with:
# Uncomment these two lines if you wish to use the Global API Key (Not recommended!)
# accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }}
# apiKey: ${{ secrets.CF_API_KEY }
# Use an API token (Recommended!)
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACC_ID }}
# CloudFlare Pages project name
project: ${{ secrets.CF_PAGES_PROJECT }}
# Add this if you want GitHub Deployments (see below)
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Create Slack Incoming webhook and add as variable https://hooks.slack.com/...
slackWebHook: ${{ secrets.SLACK_WEBHOOK }}
# Add this if you want to wait for a deployment triggered by a specfied commit
commitHash: ${{ steps.push-changes.outputs.commit-hash }}
Example
name: Deploy
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Await CF Pages and send Slack notification
id: cf-pages
uses: arddluma/cloudflare-pages-slack-notification@v4
with:
# Uncomment these two lines if you wish to use the Global API Key (Not recommended!)
# accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }}
# apiKey: ${{ secrets.CF_API_KEY }}
# Use an API token (Recommended!)
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACC_ID }}
# CloudFlare Pages project name
project: ${{ secrets.CF_PAGES_PROJECT }}
# Create Slack Incoming webhook and add as variable https://hooks.slack.com/...
slackWebHook: ${{ secrets.SLACK_WEBHOOK }}
# Add this if you want GitHub Deployments (see below)
githubToken: ${{ secrets.GITHUB_TOKEN }}
Screenshots
If build phase fails:

If deployment phase is successful:

Outputs
id- Deployment ID, example:50ff553c-da5d-4846-8188-25ae82a3bb7denvironment- Envrionment for this deployment, eitherproductionorpreviewurl- URL for this deploymentalias- Alias URL (Will be the branch URL such asfix-issue.project.pages.devor be the deployment URL)success- If the deployment was successful
GitHub Deployments
GitHub Deployments will show if the deployment was successful or failed right inside GitHub! You can easily see the status, view the website (exact deployment) and see the logs.
Note: You need to add the
githubTokeninput in order for deployments to work!
Overview

Pull Requests
In Progress

Successful
