Skip to content

Commit 6f5c7c2

Browse files
committed
Added CI / CD pipeline
1 parent 0b59885 commit 6f5c7c2

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Deploy on EC2-Instance
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Docker Image CI"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
deploy:
11+
name: Deploy to EC2
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: Deploy via SSH
17+
uses: appleboy/ssh-action@v0.1.10
18+
with:
19+
host: ${{secrets.HOST_DNS}}
20+
username: ${{secrets.EC2_USER}}
21+
key: ${{secrets.EC2_SSH_KEY}}
22+

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: ["deploy"]
6+
7+
jobs:
8+
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- users: actions/checkout@v3
15+
- name: Login Dockerhub
16+
env:
17+
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
18+
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
19+
run: docker login - u $DOCKER_USERNAME -p $DOCKER_PASSWORD
20+
21+
- name: Build the Docker image
22+
run: docker build -t quiz-slayer-env Frontend/.
23+
- name: Push Docker image
24+
run: docker push thomastejedor/quiz-slayer-env:latest
25+

0 commit comments

Comments
 (0)