From 0a86cbd34a139b780e20c093d41faf2b141f0c0b Mon Sep 17 00:00:00 2001 From: "kirill.chalov" Date: Wed, 8 Jan 2025 11:20:07 +0800 Subject: [PATCH] feat: replace s3-sync action with aws-cli command --- .github/workflows/prw-deploy-preview.yml | 38 ++++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/prw-deploy-preview.yml b/.github/workflows/prw-deploy-preview.yml index 1a39d788..48579e5c 100644 --- a/.github/workflows/prw-deploy-preview.yml +++ b/.github/workflows/prw-deploy-preview.yml @@ -70,13 +70,22 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Sync public folder with S3 bucket (public) - uses: jakejarvis/s3-sync-action@master - with: - args: --follow-symlinks --delete --cache-control no-cache +# Think how to deduplicate downloading checksums-ci from artifacts and copying to s3 bucket + + # - name: Sync public folder with S3 bucket (public) + # uses: jakejarvis/s3-sync-action@master + # with: + # args: --follow-symlinks --delete --cache-control no-cache + # env: + # SOURCE_DIR: './public' + # DEST_DIR: "pr${{ needs.determine-sync-status.outputs.pr-number }}" + + - name: Sync local folder with S3 bucket (public-update) + run: | + aws s3 sync "$SOURCE_DIR" "$DEST_DIR" --follow-symlinks --delete --cache-control no-cache env: SOURCE_DIR: './public' - DEST_DIR: "pr${{ needs.determine-sync-status.outputs.pr-number }}" + DEST_DIR: "s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ needs.determine-sync-status.outputs.pr-number }}" - name: Download checksums-ci.txt from artifacts uses: actions/download-artifact@v4 @@ -145,13 +154,24 @@ jobs: run: | aws s3 cp ./checksums-ci.txt s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ needs.determine-sync-status.outputs.pr-number }}/checksums-s3.txt + # - name: Sync local folder with S3 bucket (public-update) + # uses: jakejarvis/s3-sync-action@master + # with: + # args: --follow-symlinks --cache-control no-cache + # env: + # SOURCE_DIR: './public-update' + # DEST_DIR: "pr${{ needs.determine-sync-status.outputs.pr-number }}" + + # - name: Sync local folder with S3 bucket (public-update) + # run: | + # aws s3 sync ./public-update "s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ needs.determine-sync-status.outputs.pr-number }}" --follow-symlinks --cache-control no-cache + - name: Sync local folder with S3 bucket (public-update) - uses: jakejarvis/s3-sync-action@master - with: - args: --follow-symlinks --cache-control no-cache + run: | + aws s3 sync "$SOURCE_DIR" "$DEST_DIR" --follow-symlinks --cache-control no-cache env: SOURCE_DIR: './public-update' - DEST_DIR: "pr${{ needs.determine-sync-status.outputs.pr-number }}" + DEST_DIR: "s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ needs.determine-sync-status.outputs.pr-number }}" notifications-and-cleanup: runs-on: ubuntu-latest