From 34eb04bb6cf05a8e2c05b0b8b3fa9fc858d3b7ca Mon Sep 17 00:00:00 2001 From: aboyko Date: Wed, 15 Nov 2023 19:12:20 -0500 Subject: [PATCH] GHA: Create onw osx specific cache purge action --- .github/actions/akamai-purge-osx/action.yml | 36 +++++++++++++++++++++ .github/workflows/akamai-purge-cache.yml | 20 +++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/actions/akamai-purge-osx/action.yml diff --git a/.github/actions/akamai-purge-osx/action.yml b/.github/actions/akamai-purge-osx/action.yml new file mode 100644 index 000000000..1f3819846 --- /dev/null +++ b/.github/actions/akamai-purge-osx/action.yml @@ -0,0 +1,36 @@ +name: Akamai Purge on OSX +description: Purge Cache via Akamai Client API CLI on Mac OSX +inputs: + command: + description: The command from akamai purge command + required: true + default: invalidate + type: + description: Type of Ref, i.e. (tags, cpcode, url) + required: false + default: url + ref: + description: References tags, urls, etc + required: true + network: + description: Network (production or staging) + required: true + default: production +runs: + using: "composite" + steps: + - name: Setup + run: | + echo -e "${EDGERC}" > ${HOME}/.edgerc + brew install go + brew install akamai + akamai install purge + - name: Purge + run: | + akamai purge --edgerc ${HOME}/.edgerc --section ccu ${{ inputs.command }} ${{ inputs.network }} ${{ inputs.type }} ${{ inputs.ref }} + - name: Cleanup + if: ${{ always() }} + run: | + rm -f ${HOME}/.edgerc + brew uninstall akamai + brew uninstall go diff --git a/.github/workflows/akamai-purge-cache.yml b/.github/workflows/akamai-purge-cache.yml index c04e8f897..f9dd2e406 100644 --- a/.github/workflows/akamai-purge-cache.yml +++ b/.github/workflows/akamai-purge-cache.yml @@ -10,8 +10,10 @@ on: jobs: - eclipse-distro-build: + purge1: runs-on: self-hosted + outputs: + urls: ${{ steps.prepare-urls.outputs.urls }} steps: - name: Create .edgerc file env: @@ -64,3 +66,19 @@ jobs: rm -f ${HOME}/.edgerc brew uninstall akamai brew uninstall go + + + purge2: + runs-on: self-hosted + needs: [ purge1 ] + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + with: + sparse-checkout: | + .github + - uses: ./.github/actions/akamai-purge-osx + with: + command: invalidate + type: url + network: production + ref: ${{ needs.purge1.outputs.urls }} \ No newline at end of file