-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (40 loc) · 1.34 KB
/
deploy.yml
File metadata and controls
52 lines (40 loc) · 1.34 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
# name: Deploy
# on:
# push:
# branches:
# - main
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up JDK 21
# uses: actions/setup-java@v3
# with:
# java-version: '21'
# distribution: 'temurin'
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@v3
# - name: Make application.properties
# run: |
# mkdir -p ./src/main/resources
# echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
# shell: bash
# - name: Build with Gradle
# run: ./gradlew build -x test
# - name: Docker Build & Push
# run: |
# echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_ID }} --password-stdin
# docker build -f ./Docker/Dockerfile -t ${{ secrets.DOCKER_REPO }}:latest .
# docker push ${{ secrets.DOCKER_REPO }}:latest
# - name: Deploy to Prod
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.EC2_HOST }}
# username: ${{ secrets.EC2_USERNAME }}
# key: ${{ secrets.EC2_PRIVATE_KEY }}
# script: |
# cd ~/app
# docker compose down
# docker compose pull
# docker compose up -d