-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.36 KB
/
deployer.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: ♻️ deploy
on:
workflow_dispatch:
inputs:
skipTests:
type: boolean
description: Skip Tests
default: false
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
- name: Build with Tests
if: ${{ !inputs.skipTests }}
run: ./gradlew build --continue -s
env:
REGISTRY_PAT: ${{ github.token }}
- name: Build without Tests
if: ${{ inputs.skipTests }}
run: ./gradlew assemble -x test -s
env:
REGISTRY_PAT: ${{ github.token }}
- uses: actions/upload-artifact@v4 # Objective 2
with:
name: demo.jar
path: build/libs/demo-0.0.1-SNAPSHOT.jar
deploy:
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/download-artifact@v4 # Objective 3
with:
name: demo.jar
- name: list files
run: |
ls -trl
- name: deploy (mock)
run: |
if [ ! -f demo-0.0.1-SNAPSHOT.jar ]; then
echo "File does not exist"
exit 1
fi