GHA: Check Akamai git action

This commit is contained in:
aboyko
2023-11-15 12:16:05 -05:00
parent da3b20a984
commit c28a8f8a08

View File

@@ -13,16 +13,16 @@ jobs:
eclipse-distro-build:
runs-on: self-hosted
steps:
- name: Create .edgerc file
run: |
echo "[ccu]" >> ${HOME}/.edgerc
echo "client_secret = ${{ secrets.AKAM_CLIENT_SECRET }}" >> ${HOME}/.edgerc
echo "host = ${{ secrets.AKAM_HOST }}" >> ${HOME}/.edgerc
echo "access_token = ${{ secrets.AKAM_ACCESS_TOKEN }}" >> ${HOME}/.edgerc
echo "client_token = ${{ secrets.AKAM_CLIENT_TOKEN }}" >> ${HOME}/.edgerc
brew install go
brew install akamai
akamai install purge
# - name: Create .edgerc file
# run: |
# echo "[ccu]" >> ${HOME}/.edgerc
# echo "client_secret = ${{ secrets.AKAM_CLIENT_SECRET }}" >> ${HOME}/.edgerc
# echo "host = ${{ secrets.AKAM_HOST }}" >> ${HOME}/.edgerc
# echo "access_token = ${{ secrets.AKAM_ACCESS_TOKEN }}" >> ${HOME}/.edgerc
# echo "client_token = ${{ secrets.AKAM_CLIENT_TOKEN }}" >> ${HOME}/.edgerc
# brew install go
# brew install akamai
# akamai install purge
- name: Cloudgate S3 Configuration
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a
with:
@@ -33,16 +33,34 @@ jobs:
aws-region: us-east-1
role-duration-seconds: 900
role-skip-session-tagging: true
- name: Akamai Cache Purge via CLI
- name: Prepare URLs
id: prepare-urls
run: |
urls=`aws s3 ls s3://tools-spring-io/${{ inputs.path }} --recursive | awk '{$1=$2=$3=""; print $0}' | sed -e 's/^[ \t]*/https:\/\/cdn.spring.io\/spring-tools\//' | paste -sd' ' -`
echo $urls
akamai purge invalidate $urls
echo "urls=$urls" >> $GITHUB_OUTPUT
# - name: Akamai Cache Purge via CLI
# run: |
# urls=`aws s3 ls s3://tools-spring-io/${{ inputs.path }} --recursive | awk '{$1=$2=$3=""; print $0}' | sed -e 's/^[ \t]*/https:\/\/cdn.spring.io\/spring-tools\//' | paste -sd' ' -`
# echo $urls
# akamai purge invalidate $urls
# aws s3 ls s3://tools-spring-io/${{ inputs.path }} --recursive | awk '{$1=$2=$3=""; print $0}' | sed -e 's/^[ \t]*/https:\/\/cdn.spring.io\/spring-tools\//' | akamai purge invalidate
# akamai purge invalidate https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html
- name: Remove .edgerc file
if: ${{ always() }}
- name: Check URLs
run: |
rm -f ${HOME}/.edgerc
brew uninstall akamai
brew uninstall go
echo "${{ steps.prepare-urls.outputs.urls }}"
- name: Clear Cache
uses: jdmevo123/akamai-purge-action@962351e8415c03abe809a146403cb813c8dc3be4
env:
EDGERC: ${{ secrets.EDGERC }}
with:
command: 'invalidate'
type: 'url'
ref: ${{ steps.prepare-urls.outputs.urls }}
network: 'production'
# - name: Remove .edgerc file
# if: ${{ always() }}
# run: |
# rm -f ${HOME}/.edgerc
# brew uninstall akamai
# brew uninstall go