From 6dda980a8e61c7cd83e268e25c284b7d15cbcc38 Mon Sep 17 00:00:00 2001 From: Kwan Rimorin John Eric Date: Wed, 4 Oct 2023 09:59:49 +0800 Subject: [PATCH] ci: add CF notification --- .github/workflows/cloudflare.yaml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/cloudflare.yaml diff --git a/.github/workflows/cloudflare.yaml b/.github/workflows/cloudflare.yaml new file mode 100644 index 00000000..a69792dd --- /dev/null +++ b/.github/workflows/cloudflare.yaml @@ -0,0 +1,33 @@ +name: Cloudflare Pages +on: + check_run: + types: [completed] + +jobs: + build: + name: Feature Branch Deployment + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Get Deployment URL + run: echo "DEPLOYMENT_URL=$(echo "${{ github.event.check_run.output.summary }}" | grep -o "href\=.*>https" | cut -c 7-43)" >> $GITHUB_ENV + - run: echo $DEPLOYMENT_URL + - name: Deployment notification + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: ${{ secrets.SLACK_API_CHANNEL_ID }} + payload: | + { + "attachments": [ + { + "color": "good", + "fields": [ + { + "title": "*Feature branch deployed*", + "value": "$DEPLOYMENT_URL" + } + ] + } + ] + }