Skip to content

AWS S3 Deployment

Dennis Chacko edited this page May 15, 2021 · 2 revisions

S3 Bucket

To host Angular as a static website on Amazon S3, please follow the below steps:

  • Step 1: Create a bucket

  • Step 2: Edit Block Public Access settings

  • Step 3: Create the below two secrets in your GitHub repository

    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY

    Please reference Official GitHub Secrets Documentation for guidance

  • Step 4: Update the bucket policy with your S3 bucket name The policy document can be located under the .github/workflows folder. Edit the policy.json file and replace line#12 with the name of your S3 bucket

  • Step 5: Edit the deploy.yml file to update the S3 bucket each time you merge new code into the master or main branch The deploy.yml file can be located under the .github/workflows folder. Edit lines 38 - 42 and replace my-angular-template with the name of your S3 bucket

  • Step 6: Merge the code into the master or main branch by opening a new PR request. Once the PR request has been merged, the GitHub Actions workflow will launch and deploy the application to your S3 bucket

Your website should now be available at http://{bucket-name}.s3-website-{aws-region}.amazonaws.com/

Clone this wiki locally