From cd12bd1486842fb8979ec50bbbdec3bf98d70b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 29 Apr 2022 13:16:14 -0300 Subject: [PATCH 1/2] Use iam role and new (stage) s3 bucket --- .github/workflows/ci-cd.yml | 42 ++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 6ba5a3b3f..7c118eaa2 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,15 +12,15 @@ jobs: build: name: Build runs-on: ubuntu-latest + services: + redis: + image: redis + ports: + - 6379:6379 steps: - name: Checkout code uses: actions/checkout@v2 - - name: Install redis - run: sudo apt-get install -y redis-tools redis-server - - name: Check Redis - run: redis-cli ping - - name: Set up nodejs uses: actions/setup-node@v2 with: @@ -45,7 +45,25 @@ jobs: - name: npm Build run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build - - name: Deploy S3 Development + - name: Configure AWS credentials (development) + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::079419646996:role/public-assets + aws-region: us-east-1 + + - name: Upload to S3 (development) + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks --cache-control max-age=31536000,public + env: + AWS_S3_BUCKET: 'split-public-stage' + SOURCE_DIR: './umd' + DEST_DIR: sdk + + # TODO: Remove this upload step to the old (dev) Bucket + - name: Upload to S3 (development) (legacy) if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} uses: jakejarvis/s3-sync-action@v0.5.1 with: @@ -58,15 +76,19 @@ jobs: SOURCE_DIR: './umd' DEST_DIR: sdk - - name: Deploy S3 Master + - name: Configure AWS credentials (master) + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::825951051969:role/public-assets + aws-region: us-east-1 + + - name: Upload to S3 (master) if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: jakejarvis/s3-sync-action@v0.5.1 with: args: --acl public-read --follow-symlinks --cache-control max-age=31536000,public env: AWS_S3_BUCKET: 'split-public' - AWS_ACCESS_KEY_ID: ${{ secrets.PUBLIC_ASSETS_PROD_USER }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.PUBLIC_ASSETS_PROD_KEY }} - AWS_REGION: 'us-east-1' SOURCE_DIR: './umd' DEST_DIR: sdk From 188e8affc50f2ed974158ca05c6ebe85291f9a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 29 Apr 2022 13:50:51 -0300 Subject: [PATCH 2/2] Install redis via apt --- .github/workflows/ci-cd.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 7c118eaa2..c530137cf 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,15 +12,16 @@ jobs: build: name: Build runs-on: ubuntu-latest - services: - redis: - image: redis - ports: - - 6379:6379 steps: - name: Checkout code uses: actions/checkout@v2 + - name: Install redis + run: sudo apt-get install -y redis-tools redis-server + + - name: Check Redis + run: redis-cli ping + - name: Set up nodejs uses: actions/setup-node@v2 with: