-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (40 loc) · 1.14 KB
/
backend-cd-workflow-dev.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
name: deploy
on:
push:
branches: [ "develop" ]
paths:
- "backend/**"
jobs:
build:
runs-on: self-hosted-dev
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "corretto"
- name: create-json
uses: jsdaniell/[email protected]
with:
name: "firebase-friendogly-private-key.json"
json: ${{ secrets.FIREBASE_FRIENDOGLY_PRIVATE_KEY }}
dir: './backend/src/main/resources/'
- name: Grant execute permission for gradlew
working-directory: ./backend
run: chmod +x gradlew
- name: Build project using Gradle
working-directory: ./backend
run: ./gradlew build
deploy:
needs: build
runs-on: self-hosted-dev
steps:
- name: Change permission
run: |
sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/_work/2024-friendogly
- name: Deploy
run: |
sudo chmod +x /home/ubuntu/deploy/deploy.sh
sudo /home/ubuntu/deploy/deploy.sh