-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.22 KB
/
cd.yml
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
42
43
44
45
46
47
48
49
name: deploy grida apis
on:
push:
branches: [ "prod" ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: login docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_EMAIL }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: clean gradle projects
run: ./gradlew grida-core:core-api:clean
- name: build core api
run: ./gradlew grida-core:core-api:build
- name: docker build and push to hub sso-application
uses: docker/build-push-action@v3
with:
context: ./grida-core/core-api
file: ./grida-core/core-api/Dockerfile
push: true
tags: wwan13/grida-core-api:prod
- name: deploy to aws instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
key: ${{ secrets.REMOTE_PRIVATE_KEY }}
port: 22
script: |
sudo ./remote/scripts/deploy.sh