-
Notifications
You must be signed in to change notification settings - Fork 9.3k
36 lines (31 loc) · 1.24 KB
/
sync-chart-cloudflare-index.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
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-esp.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-esp.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 bitnami/index.yaml