File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,23 @@ jobs:
1717 steps :
1818 - uses : actions/checkout@v4
1919
20- - name : Install gcloud
20+ - name : Configure S3 CLI
2121 env :
22- GOOGLE_SERVICE_ACCOUNT_JSON_KEY : ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON_KEY }}
22+ AWS_ACCESS_KEY_ID : ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
23+ AWS_SECRET_ACCESS_KEY : ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
24+ AWS_S3_ENDPOINT : ${{ secrets.CLOUDFLARE_R2_ENDPOINT }}
2325 run : |
24- echo "install gcloud cli"
25- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
26- echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
26+ echo "install aws cli"
2727 sudo apt-get -qq update || true
28- sudo apt-get install google-cloud-cli
28+ sudo apt-get install -y python3-pip
29+ pip3 install awscli
2930 echo
30- echo "configure gcloud auth"
31- echo "$GOOGLE_SERVICE_ACCOUNT_JSON_KEY" > "$HOME"/gcloud.json
32- gcloud auth activate-service-account --key-file=$HOME/gcloud.json
31+ echo "configure aws credentials"
32+ aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
33+ aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
34+ aws configure set region us-east-1
35+ aws configure set s3.signature_version s3v4
36+ aws configure set endpoint_url $AWS_S3_ENDPOINT
3337
3438 - name : Prepare git
3539 env :
Original file line number Diff line number Diff line change 3636
3737publish :
3838 @echo " publishing files"
39- gsutil -m rsync -a public-read -d -r $$(pwd ) /files gs://cdn.appscode.com/files
40- # gsutil -m acl ch -u AllUsers:R -r gs://cdn.appscode.com/files
39+ aws s3 sync $$(pwd ) /files s3://cdn-appscode-com/files --delete --acl public-read
4140 @echo " publishing images"
42- gsutil -m rsync -d -a public-read -r $$(pwd ) /images gs://cdn.appscode.com/images
43- # gsutil -m acl ch -u AllUsers:R -r gs://cdn.appscode.com/images
41+ aws s3 sync $$(pwd ) /images s3://cdn-appscode-com/images --delete --acl public-read
You can’t perform that action at this time.
0 commit comments