-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (55 loc) · 1.43 KB
/
github-actions.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
#name: Java CD with Gradle
#
#on:
# push:
# branches: [ "master" ]
#
#permissions:
# contents: read
#
#jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
#
# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: '11'
# distribution: 'temurin'
#
# - name: Make application.yml
# run: |
# cd ./src/main/resources
# touch ./application.yml
# echo "${{ secrets.YML }}" > ./application.yml
# shell: bash
#
# - name: Build with Gradle
# run: |
# chmod +x ./gradlew
# ./gradlew clean build -x test
#
# - name: Docker build & push to docker repo
# run: |
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker build -f Dockerfile -t ${{ secrets.DOCKER_REPO }}/jjoing .
# docker push ${{ secrets.DOCKER_REPO }}/jjoing
#
# - name: Deploy to server
# uses: appleboy/ssh-action@master
# id: deploy
# with:
# host: ${{ secrets.HOST }}
# username: ubuntu
# key: ${{ secrets.KEY }}
# envs: GITHUB_SHA
# script: |
# sudo docker rm -f $(docker ps -qa)
# sudo docker pull ${{ secrets.DOCKER_REPO }}/jjoing
# docker-compose up -d
# docker image prune -f
# cd /docker
# docker-compose up -d