# Deploying Any Portfolio Website using GitHub Actions on AWS...

In this blog, We are Deploying Any Portfolio Website using GitHub Actions on AWS... **Please follow the simple steps.**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680954232778/694a7e50-d537-4fdf-a03b-a1edcb6e70b5.png align="center")

1. **GitHub Account**
    
    . Create one repo.
    
2. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680958359978/565b0247-8827-4f60-ae93-6027ff435b5e.png align="center")
    

1. **Copy and paste code in main.yml**
    

name: Portfolio Deployment on: push: branches: - main jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v1 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ [secrets.AWS](http://secrets.AWS)\_ACCESS\_KEY\_ID }} aws-secret-access-key: ${{ [secrets.AWS](http://secrets.AWS)\_SECRET\_ACCESS\_KEY }} aws-region: us-east-1 - name: Deploy static site to S3 bucket run: aws s3 sync . s3://bucketonly --delete

**2\. Aws Account**

. Create S3 bucket in AWS.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680958723393/227f90c8-7b32-4676-8c13-b46f449e31ca.png align="center")

Then Go to IAM to create User and give permission .

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680959250968/80c80be2-9b12-4201-af63-912b71e01de2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680967530797/351f22f9-2ba3-44d4-8846-4679298c8393.png align="center")

Copy Secret keys and paste in **github repo's** setting

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680959378857/fbacec07-b321-45f5-a330-38511ba6a34d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680959538814/32d22d03-d4bb-4a77-bbd9-151bc014ceba.png align="center")

Add secret key and Id here

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680960172657/612679cc-764a-4966-bfbc-f5bbc91ce3d5.png align="center")

see sample snapshot:-

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680960490712/3fbecc2e-dec8-41d8-8259-3db3d928f927.png align="center")

Copy name of bucket and paste in main.yml

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680960574896/674e4e4c-55af-46c6-a93b-7195c07c56c1.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680961296506/9a440118-7379-4409-aeb0-9ce90effde84.png align="center")

Just enable static website in s3

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680963418736/aa3c23fb-f781-4064-9b6b-d6fa090537ee.png align="center")

When you hit this URL and got error :-**403 Forbidden.**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680963711348/9b1a385a-a3bf-45e6-a42c-5b019e268881.png align="center")

**Its means you need to give bucket's policy permision in s3 .**

{ "Version": "2012-10-17", "Statement": \[ { "Sid": "PublicReadGetObject", "Principal": "*", "Effect": "Allow", "Action":"s3:GetObject*", "Resource": "arn:aws:s3:::bucketonly/\*" } \] }

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680965109246/ad5d368b-d25c-44dd-8d75-4203d8490605.png align="center")

**Successfully All job completed...**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680967393092/6ca65f46-24b4-4a24-bc5c-3c4c70811832.png align="center")
