From 7ae8e66a3a43d126e95d0ce977be93ed4e4949f6 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Sun, 6 Nov 2022 03:44:02 -0500 Subject: ci: add cache clearing to PR merges (#874) * ci: add cache clearing to PR merges * some renaming * small change to force cache * add manual run option --- .github/workflows/build_releases.yml | 2 +- .github/workflows/clear-pr-cache.yml | 26 ++++++++++++++++++++++++++ .github/workflows/test-docs.yml | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/clear-pr-cache.yml (limited to '.github/workflows') diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index a7d536a4..bc090a4c 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -6,7 +6,7 @@ # - FreeBSD (x86_64) # - macOS (aarch64) -name: "Build Releases" +name: "build releases" on: workflow_dispatch: diff --git a/.github/workflows/clear-pr-cache.yml b/.github/workflows/clear-pr-cache.yml new file mode 100644 index 00000000..356884d4 --- /dev/null +++ b/.github/workflows/clear-pr-cache.yml @@ -0,0 +1,26 @@ +# Simple job to clear the cache used by a PR when it is closed/merged. + +name: "clear PR cache" + +on: + workflow_dispatch: + inputs: + id: + description: "Which id to clear:" + required: false + pull_request: + types: + - closed + +jobs: + clear-cache: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - run: | + if [[ -z "${{ github.event.inputs.id }}" ]]; then + python ./scripts/clear_cache.py ${{ github.event.pull_request.number }} + else + python ./scripts/clear_cache.py ${{ github.event.inputs.id }} + fi diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index e46bd909..8364e493 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -1,6 +1,6 @@ # Small CI workflow to test if mkdocs documentation can be successfully built. -name: test-docs +name: test docs on: workflow_dispatch: pull_request: -- cgit v1.2.3