-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (35 loc) · 1018 Bytes
/
ci-cd-for-test.yml
File metadata and controls
41 lines (35 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Docker Image CI && Deploy to EC2 for Test Server
on:
push:
branches: ['release/**', develop]
jobs:
job1:
name: Docker Image CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v2.0.0
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build and push Docker images
uses: docker/build-push-action@v3.1.1
with:
context: .
tags: quickarchive/quickarchive_api:test
push: true
job2:
needs: job1
name: Deploy to EC2
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ubuntu
key: ${{ secrets.KEY_PAIR }}
script: |
sh /home/ubuntu/actions-runner/deploy_test_server.sh