-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (68 loc) · 2.2 KB
/
deploy.yml
File metadata and controls
82 lines (68 loc) · 2.2 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# name: Deploy Spring Boot Application
# on:
# push:
# branches:
# - release # Set this to the branch you want to deploy from
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Set up JDK 21
# uses: actions/setup-java@v2
# with:
# java-version: '21'
# distribution: 'adopt'
# - name: Build with Maven
# run: mvn -B package --file pom.xml -DskipTests
# - name: Upload Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Testify-Backend.jar
# path: target/Testify-Backend.jar
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Download Artifact
# uses: actions/download-artifact@v2
# with:
# name: Testify-Backend.jar
# - name: Environment variables
# run: echo "${{ secrets.ENV }}" >> .env
# - name: Copy files via SCP
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.DIGITALOCEAN_IP }}
# username: ${{ secrets.DIGITALOCEAN_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# port: 22
# # copy jar and .env file
# source: "*"
# target: "/opt/testify/backend"
# # deploy:
# # runs-on: ubuntu-latest
# # needs: build
# # steps:
# # - name: Checkout code
# # uses: actions/checkout@v2
# # - name: Copy files via SCP
# # uses: appleboy/scp-action@master
# # with:
# # host: ${{ secrets.DIGITALOCEAN_IP }}
# # username: ${{ secrets.DIGITALOCEAN_USERNAME }}
# # key: ${{ secrets.SSH_PRIVATE_KEY }}
# # port: 22
# # source: "target/*.jar" # Adjust based on where your build artifacts are located
# # target: "/opt/testify/backend" # Adjust based on where you want to copy the files
# - name: Restart server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.DIGITALOCEAN_IP }}
# username: ${{ secrets.DIGITALOCEAN_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# port: 22
# script: |
# systemctl stop testify
# systemctl start testify