From 1c18bb9dbc6e575575e5b46cf04b9507a6f2de53 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 29 Oct 2022 10:43:03 +0800 Subject: [PATCH] test: sync thumb images --- .github/prepare-thumb-images.sh | 5 +---- .github/workflows/cd.yml | 1 + .github/workflows/staging.yml | 26 +++++++++++++++++++------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/prepare-thumb-images.sh b/.github/prepare-thumb-images.sh index 4a2b9f7..1a8d9c8 100755 --- a/.github/prepare-thumb-images.sh +++ b/.github/prepare-thumb-images.sh @@ -28,7 +28,4 @@ for row in $($packages | jq -r '.[] | @base64'); do done # replace packages.json with the updated version with localized image links -mv $temp_packages $1 - -# upload thumb images to production cdn -aws s3 sync ./packages_thumbs_images s3://www.tea.xyz/Images/packages \ No newline at end of file +mv $temp_packages $1 \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 013357c..0cf66e1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -71,6 +71,7 @@ jobs: --exclude 'pour.sh' \ --exclude 'tea.white-paper*.pdf' \ --exclude '*.md' \ + --exclude 'public/Images/packages/*' \ --delete #TODO create a github-action that can be used to parse the diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index ff5b9df..bdea9f9 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -92,17 +92,23 @@ jobs: with: cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages' - - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Download and Upload package thumbnails from Airtable + - name: Download package thumbnails from Airtable uses: getneil/jq-action@v1 with: cmd: '.github/prepare-thumb-images.sh src/data/packages.json' + - name: Upload package thumbnails to AWS S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks + env: + AWS_S3_BUCKET: www.tea.xyz + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-east-1' + SOURCE_DIR: 'packages_thumbs_images' + DEST_DIR: 'Images/packages' + # - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} # - uses: teaxyz/setup@v0 @@ -124,6 +130,12 @@ jobs: # with: # working-directory: .cdk + # - uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: us-east-1 + # - name: Deploy to AWS # id: cdk_deploy # run: yarn deploy