-
Notifications
You must be signed in to change notification settings - Fork 209
42 lines (39 loc) · 1.64 KB
/
akamai-purge-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Akamai Purge Cache for Directory
on:
workflow_dispatch:
inputs:
path:
description: Path in S3 bucket
required: true
type: string
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 akamai
akamai install purge
- name: Cloudgate S3 Configuration
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a
with:
aws-access-key-id: ${{ secrets.TOOLS_CLOUDGATE_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TOOLS_CLOUDGATE_SECRET_KEY }}
role-to-assume: arn:aws:iam::${{ secrets.TOOLS_CLOUDGATE_ACCOUNT_ID }}:role/${{ secrets.TOOLS_CLOUDGATE_USER }}
role-session-name: ${{ github.run_id }}
aws-region: us-east-1
role-duration-seconds: 900
role-skip-session-tagging: true
- name: Akamai Cache Purge via CLI
run: |
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
- name: Remove .edgerc file
if: ${{ always() }}
run: |
rm -f ${HOME}/.edgerc
brew uninstall akamai