forked from I-TECH/openmrs-module-kenyacore
-
Notifications
You must be signed in to change notification settings - Fork 54
66 lines (53 loc) · 1.73 KB
/
mekom_cicd.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
59
60
61
62
63
64
65
66
name: Deploy to Mekom
on:
# Manually triggered workflow using the "Run workflow" button
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
#set up the build enviroment
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
# Build with Maven
- name: Build with Maven
run: mvn -B package -DskipTests
publish:
runs-on: ubuntu-latest
# Define dependencies, this job depends on the completion of the "build" job
needs: build
# Specify conditions for when this job should run
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
# Set up enviroment for Publish
steps:
# Step 1: Set up JDK 8 for Publish
- name: Set up JDK 8 for Publish
uses: actions/checkout@v4
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
server-id: mks-nexus
server-username: $MAVEN_USERNAME
server-password: $MAVEN_TOKEN
- name: Debugging pom file not found
run: ls /home/runner/work/openmrs-module-kenyacore/openmrs-module-kenyacore
- name: debugging
run: ls
- name: Debugging pom file not found two
run: ls ${{ github.workspace }}
- name: Publish to Mekom repository
run: mvn -B deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}