Skip to content

Commit

Permalink
ci: use new aws role
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjhoa committed Dec 27, 2023
1 parent 1639722 commit e8ff85d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
configuration: staging
secrets:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-role-arn: ${{ secrets.AWS_ROLE_ARN }}
s3-bucket-name: ${{ secrets.S3_BUCKET_NAME }}
cloudflare-zone: ${{ secrets.CLOUDFLARE_ZONE }}
cloudflare-token: ${{ secrets.CLOUDFLARE_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
configuration: staging
secrets:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-role-arn: ${{ secrets.AWS_ROLE_ARN }}
s3-bucket-name: ${{ secrets.S3_BUCKET_NAME }}
cloudflare-zone: ${{ secrets.CLOUDFLARE_ZONE }}
cloudflare-token: ${{ secrets.CLOUDFLARE_TOKEN }}
20 changes: 8 additions & 12 deletions .github/workflows/test-build-and-deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ on:
secrets:
aws-region:
required: true
aws-access-key-id:
required: true
aws-secret-access-key:
aws-role-arn:
required: true
s3-bucket-name:
required: true
Expand Down Expand Up @@ -85,16 +83,14 @@ jobs:
with:
name: dist-and-coverage-artifacts
path: dist/
#- name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::1234567890:role/example-role
# role-session-name: samplerolesession
# aws-region: ${{ secrets.aws-region }}
# Upload a file to AWS s3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.aws-role-arn }}
aws-region: ${{ secrets.aws-region }}
- name: Copy assets to S3
run: |
AWS_REGION=${{ secrets.aws-region }} AWS_ACCESS_KEY_ID=${{ secrets.aws-access-key-id }} AWS_SECRET_ACCESS_KEY=${{ secrets.aws-secret-access-key }} aws s3 cp ./dist/dist/apps/console/ s3://${{ secrets.s3-bucket-name }}/ --recursive --exclude "index.html"
aws s3 cp ./dist/dist/apps/console/ s3://${{ secrets.s3-bucket-name }}/ --recursive --exclude "index.html"
- name: Copy index.html to S3 last
run: |
AWS_REGION=${{ secrets.aws-region }} AWS_ACCESS_KEY_ID=${{ secrets.aws-access-key-id }} AWS_SECRET_ACCESS_KEY=${{ secrets.aws-secret-access-key }} aws s3 cp ./dist/dist/apps/console/index.html s3://${{ secrets.s3-bucket-name }}/
aws s3 cp ./dist/dist/apps/console/index.html s3://${{ secrets.s3-bucket-name }}/

0 comments on commit e8ff85d

Please sign in to comment.