-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Automatic EC2 Deployment on Main Branch Updates #4
Comments
@sandviklee I need you to set secrete name: Deploy to EC2
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.EC2_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts
- name: Deploy to EC2
env:
EC2_HOST: ${{ secrets.EC2_HOST }}
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
run: |
ssh -o StrictHostKeyChecking=no $EC2_USERNAME@$EC2_HOST 'bash -s' < ./deploy_to_ec2.sh
|
This video shows how to create CD: |
How to add new Key pairs https://linux.how2shout.com/add-a-new-key-pair-to-your-exisitng-aws-ec2-instances/ How to connect to instances remotely https://www.how2shout.com/linux/how-to-ssh-aws-ec2-linux-instances-remotely/ |
As we dockerize the container the process of automatically updating production on commits on the main branch will be easier #22 |
For using Portianer we need to things:
|
Portainer.io has an automatic update feature so it can update the server from github repo. It also have good support for stacks of containers making it much easier to connect all the depolyed systems to the backend without using ssh. |
This option seems better for security and scalability according Eduard |
As the EC2 instance does not have space for portainer or much more any new projects of moderate size. Portainer can not be taken in use. We need to find a way to get more storage. |
The Cogito Backend needs to have a CI/CD pipeline to make sure everything works and to automatically deploy changes. The application is hosted on an AWS EC2 instance and the codebase is stored on GitHub. I want to automate the deployment process so that any new commits pushed to the main branch automatically trigger an update on the EC2 instance.
Acceptance Criteria:
The text was updated successfully, but these errors were encountered: