-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.39 KB
/
dev-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
50
51
52
53
54
55
56
57
58
59
60
61
62
name: develop-CD
on:
push:
branches: [ "develop" ]
jobs:
ci:
runs-on: ubuntu-22.04
env:
working-directory: .
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.SUBMODULE_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: build
run: |
chmod +x gradlew
./gradlew build -x test
shell: bash
- name: docker login
uses: docker/[email protected]
- name: login docker hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_LOGIN_USERNAME }}
password: ${{ secrets.DOCKER_LOGIN_ACCESSTOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-dev
push: true
tags: ${{ secrets.DOCKER_LOGIN_USERNAME }}/${{ secrets.DEV_REPONAME }}
cd:
needs: ci
runs-on: ubuntu-22.04
steps:
- name: docker container run
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SERVER_IP }}
username: ${{ secrets.DEV_SERVER_USER }}
key: ${{ secrets.DEV_SERVER_KEY }}
script: |
cd ~
./deploy.sh