-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.73 KB
/
ci-cd.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
56
57
58
name: LaBoulangerieMmo continuous delivery
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- '.gitignore'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: JDk 1.17 setup
uses: actions/setup-java@v1
with:
java-version: 1.17
- uses: actions/cache@v3
env:
cache-name: cache-gradle
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle/caches
key: ${{ runner.os }}-gradle-${{ env.cache-name }}-${{ hashFiles('*.gradle.kts', '**/gradle-wrapper.properties') }}
- name: Gradle Build Action
uses: gradle/[email protected]
with:
gradle-version: "7.4.1"
arguments: assemble
- name: Clean build outputs
run: rm build/libs/LaBoulangerieMmo-*dev*.jar
- uses: actions/upload-artifact@v1
with:
name: laboulangeriemmo
path: build/libs/
deploy:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/download-artifact@v2
with:
name: laboulangeriemmo
- name: Clone Plugins Project
run: |
git config --global user.name "octocroissant[bot]"
git config --global user.email 149737708+octocroissant[bot]@users.noreply.github.com
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git clone https://octocroissant[bot]:${{ secrets.PAT_TOKEN }}@github.com/LaBoulangerie/Server.git
mv *.jar LaBoulangerieMmo.jar
cp **.jar Server/plugins/
cd Server
git add .
git commit -m "Update artifact from $GITHUB_REPOSITORY"
git push