-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.62 KB
/
Copy pathdeploy_api.yml
File metadata and controls
62 lines (51 loc) · 1.62 KB
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: Deployment API
on:
workflow_dispatch:
push:
branches: [ "develop" ]
paths:
- 'coffice-api/**'
- 'coffice-domain/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: ./gradlew :coffice-api:bootJar
shell: bash
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"
- name: Show Current Time
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}"
shell: bash
- name: Build docker image
run: docker build -t yapp22ndios1st/coffice-api ./coffice-api
- name: Sign in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_DEPLOYMENT_TOKEN }}
- name: Push docker image to Docker Hub
run: docker push yapp22ndios1st/coffice-api
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ vars.API_SSH_HOST }}
port: ${{ vars.API_SSH_PORT }}
username: ${{ vars.API_SSH_USERNAME }}
key: ${{ secrets.API_SSH_PRIVATE_KEY }}
script: ${{ vars.API_SSH_SCRIPT }}