From 97d8dfe145996ac4db22d2df53de9e3e49f71293 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Wed, 6 Apr 2022 00:56:40 +0530 Subject: [PATCH] renamed file, corrected the steps in the script --- .../{build-publish-pipeline.yml => synchronize-cdn.yml} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename .github/workflows/{build-publish-pipeline.yml => synchronize-cdn.yml} (90%) diff --git a/.github/workflows/build-publish-pipeline.yml b/.github/workflows/synchronize-cdn.yml similarity index 90% rename from .github/workflows/build-publish-pipeline.yml rename to .github/workflows/synchronize-cdn.yml index 9d4b8c7..815ee25 100644 --- a/.github/workflows/build-publish-pipeline.yml +++ b/.github/workflows/synchronize-cdn.yml @@ -30,20 +30,25 @@ jobs: set -e set -o pipefail + CURRENT_DIR=$(pwd) + # Install rclone + TMPDIR=$(mktemp -d) + cd $TMPDIR curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip unzip rclone-current-linux-amd64.zip cd rclone-*-linux-amd64 - sudo cp rclone /usr/bin/ sudo chown root:root /usr/bin/rclone sudo chmod 755 /usr/bin/rclone + cd $CURRENT_DIR + # Create a S3 target rclone config create s3 s3 provider=DigitalOcean env_auth=true region=fra1 endpoint=fra1.digitaloceanspaces.com acl=public-read # remove `.github` and any other paths we do not want in the CDN - rm -rf .github + rm -rf .github .git # SYNC rclone sync -P . s3:$CDN_BUCKET/