Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
cloud

GitHub Action

Cloudflare Pages Slack Notification

v2.1 Pre-release

Cloudflare Pages Slack Notification

cloud

Cloudflare Pages Slack Notification

Wait for Cloudflare Pages to build and send Slack notification

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Cloudflare Pages Slack Notification

uses: arddluma/cloudflare-pages-slack-notification@v2.1

Learn more about this action in arddluma/cloudflare-pages-slack-notification

Choose a version

CloudFlare Pages Slack notification

Using CF Pages Await made by Daniel Walsh WalshyDev

Wait for Cloudflare Pages build to finish and send Slack notification

Usage

- name: Await CF Pages and send Slack notification
  uses: arddluma/cloudflare-pages-slack-notification@v2.1
  with:
    accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL  }}
    apiKey: ${{ secrets.CF_API_KEY  }}
    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@v2
    - name: Await CF Pages and send Slack notification
      id: cf-pages
      uses: arddluma/cloudflare-pages-slack-notification@v2.1
      with:
        accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL  }}
        apiKey: ${{ secrets.CF_API_KEY  }}
        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:

Build Fails

If deployment phase is successful:

Deployment Successful

Outputs

  • id - Deployment ID, example: 50ff553c-da5d-4846-8188-25ae82a3bb7d
  • environment - Envrionment for this deployment, either production or preview
  • url - URL for this deployment
  • alias - Alias URL (Will be the branch URL such as fix-issue.project.pages.dev or 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 githubToken input in order for deployments to work!

Overview

Successful production deployment

Pull Requests

In Progress In progress deployment in PR

Successful Successful deployment in PR