Skip to content

Commit bba2f46

Browse files
authored
Merge pull request #6 from manishprivet/added-ci-cd
Create deploy.yml
2 parents e2bc9cb + 0b5ab51 commit bba2f46

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
name: Deploy to Production
6+
7+
jobs:
8+
deploy:
9+
name: Deploy
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Push to Docker Hub
17+
uses: docker/build-push-action@v1
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
repository: poorvivaish/rce
22+
tags: latest
23+
24+
- name: Setup key
25+
id: setup-key
26+
env:
27+
EC2_KEY: ${{ secrets.EC2_KEY }}
28+
run: |
29+
echo "$EC2_KEY" >> $HOME/key.pem
30+
chmod 400 $HOME/key.pem
31+
- name: Update image on server
32+
run: ssh -i $HOME/key.pem -o StrictHostKeyChecking=no ubuntu@52.206.192.83 './deploy.sh'

0 commit comments

Comments
 (0)