Files deployed as soon as pushed
This project is an application of the real life based scenario. In this when a developer pushes file to the master/main branch of repository, Github Action gets triggered automatically. The action then performs a job, which pushes the updated code to a particular S3 bucket. Hence the deployment becomes seamless and saves time of developer.
You just need a laptop with an internet connection, a code editor and git installed for this project and it will be completed within just few clicks.
- Make sure you have an active AWS account (Free tier will also work).
- Your website files.
-
Make a S3 bucket with public access available (Give it a unique name).
-
Make a new Public repository, and go to Actions tab.
-
Click on "set up a workflow yourself".
-
Copy and paste the yaml file from this repositories "/GithubAction_file/main.yml".
-
Specify main/master branch, your preferred AWS region and your AWS bucket name.
-
Go to your AWS account and create new AWS secreat key which has AWS S3 full access.
-
Go to Settings=>Secrets and variables=>Actions then create 2 "New repository secret" named as AWS ACCESS KEY ID (put ID) and AWS SECRET ACCESS KEY (put the value).
-
Now commit this change for now.
-
Now push the website files to that github repository in which you just made the actions files.
-
Go to your S3 bucket, click on the bucket name, then go to properties, scroll till the last and turn on Static Hosting option and mention "index.html".
-
Now you will get a link for website, and we can view our website.
-
Now from the next push, the changes will be deployed automatically.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AddedFeature) - Commit your Changes (
git commit -m 'Add some AddedFeature') - Push to the Branch (
git push origin feature/AddedFeature) - Open a Pull Request
- Antarin Ghosal - IT Student - Antarin Ghosal
