Skip to content

Commit

Permalink
chorn: clean deployment env and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
qujihan committed Jan 1, 2025
1 parent d567fdb commit 28767f7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://github.com/peaceiris/actions-hugo
name: GitHub Pages
name: blog_deploy

on:
push:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/clean_deployment_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: clean_deployment_env

on:
# Run weekly, at 00:00 on sunday.
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:

jobs:
cleanup:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Delete deployment
uses: strumwolf/delete-deployment-environment@v2.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: github-pages
onlyRemoveDeployments: true
22 changes: 22 additions & 0 deletions .github/workflows/clean_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: clean_workflow

on:
# Run weekly, at 00:00 on sunday.
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:

jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Delete workflow runs for current repo
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 6

0 comments on commit 28767f7

Please sign in to comment.