mirror of
https://github.com/iLay1678/i-tools.git
synced 2025-07-02 18:22:24 +08:00
add clean up
This commit is contained in:
parent
2e83011091
commit
1956944c76
50
.github/workflows/clean-up.yml
vendored
Normal file
50
.github/workflows/clean-up.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Delete old workflow runs
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
del_runs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Delete workflow runs
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 30
|
||||
keep_minimum_runs: 6
|
||||
|
||||
# Points to a recent commit instead of `main` to avoid supply chain attacks. (The latest tag is very old.)
|
||||
- name: 🎟 Get GitHub App token
|
||||
uses: actions/create-github-app-token@v1
|
||||
id: get-token
|
||||
with:
|
||||
app-id: ${{ secrets.GH_APP_ID }}
|
||||
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Delete workflow runs for current repo
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 7
|
||||
keep_minimum_runs: 6
|
||||
|
||||
- name: Delete deployment
|
||||
uses: strumwolf/delete-deployment-environment@v2.3.0
|
||||
with:
|
||||
token: ${{ steps.get-token.outputs.token }}
|
||||
environment: Preview
|
||||
onlyRemoveDeployments: true
|
||||
|
||||
- name: Delete MAIN deployment
|
||||
uses: strumwolf/delete-deployment-environment@v2.3.0
|
||||
with:
|
||||
token: ${{ steps.get-token.outputs.token }}
|
||||
environment: Production
|
||||
onlyRemoveDeployments: true
|
31
.github/workflows/docker-build.yml
vendored
31
.github/workflows/docker-build.yml
vendored
@ -24,36 +24,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Points to a recent commit instead of `main` to avoid supply chain attacks. (The latest tag is very old.)
|
||||
- name: 🎟 Get GitHub App token
|
||||
uses: actions/create-github-app-token@v1
|
||||
id: get-token
|
||||
with:
|
||||
app-id: ${{ secrets.GH_APP_ID }}
|
||||
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Delete workflow runs for current repo
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 7
|
||||
keep_minimum_runs: 6
|
||||
|
||||
- name: Delete deployment
|
||||
uses: strumwolf/delete-deployment-environment@v2.3.0
|
||||
with:
|
||||
token: ${{ steps.get-token.outputs.token }}
|
||||
environment: Preview
|
||||
onlyRemoveDeployments: true
|
||||
|
||||
- name: Delete MAIN deployment
|
||||
uses: strumwolf/delete-deployment-environment@v2.3.0
|
||||
with:
|
||||
token: ${{ steps.get-token.outputs.token }}
|
||||
environment: Production
|
||||
onlyRemoveDeployments: true
|
||||
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user