Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arddluma/cloudflare-pages-slack-notification
GitHub Action for CloudFlare Pages Slack notifications
https://github.com/arddluma/cloudflare-pages-slack-notification
cloudflare cloudflare-pages cloudflare-pages-slack github-actions
Last synced: 10 days ago
JSON representation
GitHub Action for CloudFlare Pages Slack notifications
- Host: GitHub
- URL: https://github.com/arddluma/cloudflare-pages-slack-notification
- Owner: arddluma
- License: mit
- Created: 2022-05-05T11:24:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-04T12:28:53.000Z (over 1 year ago)
- Last Synced: 2024-10-31T10:46:56.915Z (19 days ago)
- Topics: cloudflare, cloudflare-pages, cloudflare-pages-slack, github-actions
- Language: TypeScript
- Homepage: https://ardd.cloud/setup-cloudflare-pages-slack-notifications
- Size: 560 KB
- Stars: 18
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CloudFlare Pages Slack notification
## Using [CF Pages Await](https://github.com/WalshyDev/cf-pages-await) made by Daniel Walsh [WalshyDev](https://github.com/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](.github/images/create-cf-token.png)## Usage
```yml
- 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
```yml
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](.github/images/build-failed.png)
### If deployment phase is successful:
![Deployment Successful](.github/images/deployment-succeeded.png)
## 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](https://user-images.githubusercontent.com/8492901/149387681-25ec860d-0c8e-4075-8ab0-4d289b86127b.png)### Pull Requests
**In Progress**
![In progress deployment in PR](https://user-images.githubusercontent.com/8492901/149388796-6bbd4ae9-b7b3-4d06-80c5-c18b3737f51f.png)**Successful**
![Successful deployment in PR](https://user-images.githubusercontent.com/8492901/149388892-14a7ea25-6865-4d52-b403-30e8cec449d2.png)