Skip to content

Commit

Permalink
docs: workflow templates
Browse files Browse the repository at this point in the history
  • Loading branch information
andykenward committed May 5, 2024
1 parent cdfff71 commit 43b716c
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflow-templates/delete.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Cloudflare Pages Deploy Deletion Workflow",
"description": "Deploy deletion from Cloudflare Pages using andykenward/github-actions-cloudflare-pages/delete",
"iconName": "octicon trash",
"categories": ["Deployment"]
}
27 changes: 27 additions & 0 deletions .github/workflow-templates/delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Cloudflare Pages Delete

on:
pull_request:
types:
- closed
branches:
- $default-branch
jobs:
deploy:
permissions:
actions: read # Only required for private GitHub Repo
contents: read
deployments: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@v4
- name: 'Deploy deletion from Cloudflare Pages'
uses: andykenward/github-actions-cloudflare-pages/delete@v2
with:
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflow-templates/deploy.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Cloudflare Pages Deploy Workflow",
"description": "Deploy to Cloudflare Pages using andykenward/github-actions-cloudflare-pages",
"iconName": "octicon cloud",
"categories": ["Deployment"]
}
32 changes: 32 additions & 0 deletions .github/workflow-templates/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Cloudflare Pages Deploy

on:
push:
branches:
- $default-branch
pull_request:
branches:
- $default-branch
jobs:
deploy:
permissions:
actions: read # Only required for private GitHub Repo
contents: read
deployments: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@v4
- name: 'Deploy to Cloudflare Pages'
uses: andykenward/github-actions-cloudflare-pages@v2
with:
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare-account-id: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
cloudflare-project-name: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: dist
github-token: ${{ secrets.GITHUB_TOKEN }}
github-environment: ${{ (github.ref == 'refs/heads/main' && 'production') || 'preview' }}

0 comments on commit 43b716c

Please sign in to comment.