From 3d6fc270a74b1ac7c05c64463d4f9c54b1780389 Mon Sep 17 00:00:00 2001 From: gitwoz <177856586+gitwoz@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:54:07 +0700 Subject: [PATCH 1/2] fix(ci): fix rclone --- .github/workflows/deploy.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cc19547337..743c4a1c8f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -82,17 +82,21 @@ jobs: && npm install --production \ && zip -r --symlinks deploy.zip . -x .git/\* + - name: Setup rclone + if: github.base_ref == 'develop' || github.base_ref == 'master' + uses: AnimMouse/setup-rclone@v1 + with: + rclone_config: | + [r2] + type = s3 + provider = Cloudflare + access_key_id = ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }} + secret_access_key = ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }} + endpoint = ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }} + - name: Upload Assets (develop - R2) if: github.base_ref == 'develop' - uses: andreiio/rclone-action@v1 - env: - RCLONE_CONFIG_R2_TYPE: s3 - RCLONE_CONFIG_R2_PROVIDER: Cloudflare - RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }} - RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }} - RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }} - with: - args: sync .next/static r2:matters-assets-next-develop/_next/static -P + run: rclone sync .next/static r2:matters-assets-next-develop/_next/static -P - name: Deploy to EB (develop) if: github.base_ref == 'develop' @@ -111,15 +115,7 @@ jobs: - name: Upload Assets (production - R2) if: github.base_ref == 'master' - uses: andreiio/rclone-action@v1 - env: - RCLONE_CONFIG_R2_TYPE: s3 - RCLONE_CONFIG_R2_PROVIDER: Cloudflare - RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }} - RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }} - RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }} - with: - args: sync .next/static r2:matters-assets-next/_next/static -P + run: rclone sync .next/static r2:matters-assets-next/_next/static -P - name: Deploy to EB (production) if: github.base_ref == 'master' From 3042dcbd5b22a847ffea6b5d1f848b6229e8754a Mon Sep 17 00:00:00 2001 From: gitwoz <177856586+gitwoz@users.noreply.github.com> Date: Thu, 12 Dec 2024 23:12:10 +0700 Subject: [PATCH 2/2] fix(ci): disable base64 to use plain text config --- .github/workflows/deploy.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 743c4a1c8f..166af165bb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,6 +31,19 @@ jobs: node-version: '18' cache: 'npm' + - name: Setup rclone + if: github.base_ref == 'develop' || github.base_ref == 'master' + uses: AnimMouse/setup-rclone@v1 + with: + rclone_config: | + [r2] + type = s3 + provider = Cloudflare + access_key_id = ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }} + secret_access_key = ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }} + endpoint = ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }} + disable_base64: true + - name: Install Dependencies run: npm ci @@ -82,18 +95,6 @@ jobs: && npm install --production \ && zip -r --symlinks deploy.zip . -x .git/\* - - name: Setup rclone - if: github.base_ref == 'develop' || github.base_ref == 'master' - uses: AnimMouse/setup-rclone@v1 - with: - rclone_config: | - [r2] - type = s3 - provider = Cloudflare - access_key_id = ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }} - secret_access_key = ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }} - endpoint = ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }} - - name: Upload Assets (develop - R2) if: github.base_ref == 'develop' run: rclone sync .next/static r2:matters-assets-next-develop/_next/static -P