-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CONTENT-7903] publish index file to the Cloudflare STG CDN (#27079)
Signed-off-by: Jorge Bianquetti <[email protected]> Co-authored-by: Jorge Bianquetti <[email protected]>
- Loading branch information
1 parent
95f69ae
commit ee17e26
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: '[Index] Sync bitnami/charts index.yaml to Cloudflare' | ||
|
||
on: | ||
push: | ||
branches: | ||
- index | ||
|
||
# Remove all permissions by default | ||
permissions: {} | ||
|
||
jobs: | ||
deploy: | ||
name: Sync bitnami/charts index.yaml to Cloudflare | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Upload to Cloudflare using a BCOM upload proxy | ||
env: | ||
CLOUDFLARE_CLIENT_ID: ${{ secrets.CLOUDFLARE_CLIENT_ID }} | ||
CLOUDFLARE_CLIENT_SECRET: ${{ secrets.CLOUDFLARE_CLIENT_SECRET }} | ||
CLOUDFLARE_USER_AUTH: ${{ secrets.CLOUDFLARE_USER_AUTH }} | ||
run: | | ||
export TOKEN=$(curl -s --location 'https://api-espstg.broadcom.com/auth/oauth/v2/token' \ | ||
--data-urlencode "client_id=${CLOUDFLARE_CLIENT_ID}" \ | ||
--data-urlencode "client_secret=${CLOUDFLARE_CLIENT_SECRET}" \ | ||
--data-urlencode 'grant_type=client_credentials' | jq .access_token -r ) | ||
curl --location --request PUT 'https://api-espstg.broadcom.com/crushftp/fileUpload' \ | ||
--header "userAuth: Basic ${CLOUDFLARE_USER_AUTH}" \ | ||
--header 'filePath: /index.yaml' \ | ||
--header 'Content-Type: text/yaml' \ | ||
--header "Authorization: Bearer $TOKEN" \ | ||
--upload-file binami/index.yaml |
File renamed without changes.