Skip to content

feat: Don't trigger deployment on Dependabot pr's and depend deployme… #1

feat: Don't trigger deployment on Dependabot pr's and depend deployme…

feat: Don't trigger deployment on Dependabot pr's and depend deployme… #1

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: 'Delete redundant deployments'
on:
pull_request:
types:
- closed
branches:
- main
jobs:
delete:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == 'dval-in/dval-in' }}
permissions:
contents: read
deployments: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Delete Cloudflare Pages deployments'
uses: unlike-ltd/github-actions-cloudflare-pages@159278d1b12c975d1d5e538720e4da343131ede3 #v1.3.0
with:
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
cloudflare-project-name: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: 'build'
github-token: ${{ secrets.GITHUB_TOKEN }}
github-environment: ${{ vars.CLOUDFLARE_PROJECT_NAME }} ${{ (github.ref == 'refs/heads/main' && '(Production)') || '(Preview)' }}