Step 1: Manually creating and deploying a Next.js project to a new S3 Bucket
To get started with our new S3 Bucket, first log in to your AWS account and navigate to the S3 service.
We’ll want to create a new bucket, using the name of our choice, which will be used for the S3 endpoint where our website is hosted. We’ll also want to configure our S3 bucket to be able to host a website.
then click save changes.
then go to permission to edit the bucket policy with this code
scroll down to the access control list and edit it to look like this
After setting this go over to your github repository and create a new repo and in the new repo copy the folders you would like to build into the repository like we did in the previous classes and create a folder in the repository called .github/workflows
then in that folder create a file called deploy.yml and paste this code inside there
The next step will be to add credentials to Github as secrets
Go to your Github repository -> settings -> secrets -> actions
Add new repository secret
Need to add two secrets: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (Secret access key) which will be used later in the workflow
Add AWS_SECRET and also default region too in the same way.
No comments:
Post a Comment