-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (52 loc) · 1.64 KB
/
gradle.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Java CI with Gradle
on:
push:
branches: [ "main" ]
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
steps:
# 웹 이미지 빌드 및 도커허브에 push
- name: Checkout
uses: actions/checkout@v2
## create application-database.yaml
- name: make application-aws.yaml
run: |
cd ./src/main/resources
touch ./application-aws.yml
echo "${{ secrets.AWS }}" >> ./application-aws.yml
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: jungminleeee/onna:latest
cache-from: type=gha,scope=build-main
cache-to: type=gha,mode=max,scope=build-main
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.KEY }}
port: 22
source: "docker-compose.yaml"
target: "/home/ec2-user/"
## docker compose up
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.KEY }}
port: 22
script: "docker-compose pull && docker-compose up -d"