Code Monkey home page Code Monkey logo

cloudflare-pages-slack-notification's Introduction

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 Create CF 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:

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

cloudflare-pages-slack-notification's People

Contributors

arddluma avatar henrypoydar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.