From ba41147c7a5ba633a7bd4390528b4c47ed30c1e1 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 17:07:55 +0200 Subject: [PATCH 1/7] Create synchronization.yml --- .github/workflows/synchronization.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/synchronization.yml diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml new file mode 100644 index 0000000..e9a4317 --- /dev/null +++ b/.github/workflows/synchronization.yml @@ -0,0 +1,20 @@ +on: + push: + # branches: [main] + +jobs: + synchronize: + concurrency: s3 + environment: aws-s3 + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: us-east-1 + role-to-assume: arn:aws:iam::927162227090:role/library-s3 + role-duration-seconds: 43200 # 12 hours (maximum) + - run: rclone copy . :s3,env_auth=true:library-s3 From 7282bddd775d4881e9fa87e98f6080b8aec83b93 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 17:11:57 +0200 Subject: [PATCH 2/7] Update synchronization.yml --- .github/workflows/synchronization.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml index e9a4317..261d94f 100644 --- a/.github/workflows/synchronization.yml +++ b/.github/workflows/synchronization.yml @@ -17,4 +17,6 @@ jobs: aws-region: us-east-1 role-to-assume: arn:aws:iam::927162227090:role/library-s3 role-duration-seconds: 43200 # 12 hours (maximum) - - run: rclone copy . :s3,env_auth=true:library-s3 + - run: > + go run github.com/rclone/rclone@v1 copy . + :s3,env_auth=true:library-s3 From 1f62c2e2ac24e260e575e543c57d2f540681fdff Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 17:19:27 +0200 Subject: [PATCH 3/7] Update synchronization.yml --- .github/workflows/synchronization.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml index 261d94f..7904db6 100644 --- a/.github/workflows/synchronization.yml +++ b/.github/workflows/synchronization.yml @@ -18,5 +18,5 @@ jobs: role-to-assume: arn:aws:iam::927162227090:role/library-s3 role-duration-seconds: 43200 # 12 hours (maximum) - run: > - go run github.com/rclone/rclone@v1 copy . - :s3,env_auth=true:library-s3 + go run github.com/rclone/rclone@v1 copy --exclude .git/** + . :s3,provider=AWS,env_auth=true:library-s3 From 8af95453b4db5c83910e7d180dda0e1f454f2d08 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 17:20:40 +0200 Subject: [PATCH 4/7] Update synchronization.yml --- .github/workflows/synchronization.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml index 7904db6..afbd21f 100644 --- a/.github/workflows/synchronization.yml +++ b/.github/workflows/synchronization.yml @@ -18,5 +18,5 @@ jobs: role-to-assume: arn:aws:iam::927162227090:role/library-s3 role-duration-seconds: 43200 # 12 hours (maximum) - run: > - go run github.com/rclone/rclone@v1 copy --exclude .git/** + go run github.com/rclone/rclone@v1 copy --exclude=/.** . :s3,provider=AWS,env_auth=true:library-s3 From 80cf2b6ed1208a48d24657162c24ae43d0d80f94 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 17:22:20 +0200 Subject: [PATCH 5/7] Update synchronization.yml --- .github/workflows/synchronization.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml index afbd21f..33ac051 100644 --- a/.github/workflows/synchronization.yml +++ b/.github/workflows/synchronization.yml @@ -18,5 +18,5 @@ jobs: role-to-assume: arn:aws:iam::927162227090:role/library-s3 role-duration-seconds: 43200 # 12 hours (maximum) - run: > - go run github.com/rclone/rclone@v1 copy --exclude=/.** + go run github.com/rclone/rclone@v1 copy --exclude '.**' . :s3,provider=AWS,env_auth=true:library-s3 From 907d71a7a64e0a3c4960c998f4739b59f972474b Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 18:45:51 +0200 Subject: [PATCH 6/7] Restrict pushes to the main branch Co-authored-by: Peter Springsteen --- .github/workflows/synchronization.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml index 33ac051..338bed5 100644 --- a/.github/workflows/synchronization.yml +++ b/.github/workflows/synchronization.yml @@ -1,6 +1,6 @@ on: push: - # branches: [main] + branches: [main] jobs: synchronize: From 4b216457cef01986d72119681c033fc4954fc3aa Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 18 Aug 2023 18:54:09 +0200 Subject: [PATCH 7/7] Update synchronization.yml --- .github/workflows/synchronization.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/synchronization.yml b/.github/workflows/synchronization.yml index 338bed5..bb44d87 100644 --- a/.github/workflows/synchronization.yml +++ b/.github/workflows/synchronization.yml @@ -18,5 +18,5 @@ jobs: role-to-assume: arn:aws:iam::927162227090:role/library-s3 role-duration-seconds: 43200 # 12 hours (maximum) - run: > - go run github.com/rclone/rclone@v1 copy --exclude '.**' + go run github.com/rclone/rclone@v1 sync --exclude '.**' . :s3,provider=AWS,env_auth=true:library-s3