-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from FPirazz/develop
Develop
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Deploy Application to AWS EC2 Instance | ||
on: | ||
push: | ||
branches: | ||
- prepDeploy | ||
- main | ||
|
||
jobs: | ||
Deploy: | ||
name: Deploy to EC2 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build & Deploy | ||
env: | ||
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
HOSTNAME: ${{secrets.SSH_HOST}} | ||
USER_NAME: ${{secrets.USER_NAME}} | ||
|
||
run: | | ||
echo "$PRIVATE_KEY" > ./private_key && chmod 600 ./private_key | ||
cat ./private_key | ||
ssh -o StrictHostKeyChecking=no -i ./private_key ${USER_NAME}@${HOSTNAME} ' | ||
# Now we have got the access of EC2 and we will start the deploy . | ||
kubectl delete --all svc | ||
kubectl delete --all deploy | ||
kubectl delete --all pods | ||
sudo docker container delete vue-app | ||
minikube start | ||
cd my-dashboard/ | ||
sudo docker pull leomarzoli/traffic_management_system:latest | ||
kubectl apply -f intersection-agents-deployment.yaml,intersection-agents-service.yaml,spring-db-app-deployment.yaml,spring-db-app-service.yaml,user-db-deployment.yaml,user-db-service.yaml | ||
docker run -it --rm --add-host=host.docker.internal:host-gateway -d -p 8080:80 --name vue-app leomarzoli/traffic_management_system:latest | ||
minikube tunnel -c | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters