Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add cache cleanup workflows #65

Merged
merged 6 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/linters/mlc_config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"aliveStatusCodes": [0, 200, 206, 403, 999, 406]
"aliveStatusCodes": [0, 200, 206, 429, 403, 501, 999],
"ignorePatterns": [
{
"pattern": "^https://resolver.cheqd.net/"
}
]
}
24 changes: 24 additions & 0 deletions .github/workflows/cleanup-cache-automatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Cache Cleanup - Automatic"
on:
pull_request:
types:
- closed
defaults:
run:
shell: bash


jobs:

cache-purge:
name: "Purge Actions cache"
runs-on: ubuntu-latest

steps:

- name: "Delete Branch Cache Action"
uses: snnaplab/delete-branch-cache-action@v1.0.0
with:
# Specify explicitly because the ref at the time of merging will be a branch name such as 'main', 'develop'
ref: refs/pull/${{ github.event.number }}/merge
github-token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Cleanup - Cache"
name: "Cache Cleanup - Manual"
on:
workflow_dispatch:
inputs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
call-lint:
name: "Lint"
uses: ./.github/workflows/lint.yml
secrets: inherit

call-build:
name: "Build"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ jobs:
VALIDATE_MARKDOWN: true
VALIDATE_OPENAPI: true
VALIDATE_PYTHON_PYLINT: true
VALIDATE_XML: true
VALIDATE_YAML: true
20 changes: 5 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true

- name: "Obtain Github App token"
id: app-token
uses: getsentry/action-github-app-token@v2.0.0
Expand Down Expand Up @@ -136,18 +141,3 @@ jobs:

- name: Push image to DigitalOcean Container Registry
run: docker image push --all-tags registry.digitalocean.com/${{ github.repository }}

cache-purge:
name: "Purge branch Actions cache"
needs: [release-binary, release-docker]
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest

steps:

- name: "Delete Branch Cache Action"
uses: snnaplab/delete-branch-cache-action@v1.0.0
with:
# Specify explicitly because the ref at the time of merging will be a branch name such as 'main', 'develop'
ref: refs/pull/${{ github.event.number }}/merge
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prerelease": true
}
],
"tagFormat": "${version}",
"tagFormat": "v${version}",
"ci": true,
"preset": "conventionalcommits",
"plugins": [
Expand Down