lets add them allllll #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: 8 | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml -DskipMunitTests | |
- name: Stamp artifact file name with commit hash | |
run: | | |
artifactName1=$(ls target/*.jar | head -1) | |
commitHash=$(git rev-parse --short "$GITHUB_SHA") | |
artifactName2=$(ls target/*.jar | head -1 | sed "s/.jar/-$commitHash.jar/g") | |
mv $artifactName1 $artifactName2 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: target/*.jar | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifacts | |
- name: Deploy | |
run: | | |
artifactName=$(ls *.jar | head -1) | |
mvn deploy -DskipMunitTests -DmuleDeploy \ | |
-Dmule.artifact=$artifactName \ | |
-Dconnectedapp.client.id="${{ secrets.CONNECTED_APP_CLIENT_ID }}" \ | |
-Dconnectedapp.client.secret="${{ secrets.CONNECTED_APP_CLIENT_SECRET }}" \ | |
-Drace.client.id="${{ secrets.ANYPOINT_RACE_CLIENT_ID }}" \ | |
-Drace.client.secret="${{ secrets.ANYPOINT_RACE_CLIENT_SECRET }}" \ | |
-Denv.id="${{ secrets.ENVID }}" \ | |
-Dorg.id="${{ secrets.ORGID }}" |