Skip to content

MMA prod Ci/Cd

MMA prod Ci/Cd #30

Workflow file for this run

name: MMA prod Ci/Cd
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Cache
uses: actions/[email protected]
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: mma.jar
path: build/libs/mma-*-SNAPSHOT.jar
deploy:
runs-on: self-hosted
needs: build
steps:
- name: Remove old jar file
run: rm -rf /home/ubuntu/mma/*.jar
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: mma.jar
path: /home/ubuntu/mma
- name: Add Permission
run: chmod +x /home/ubuntu/mma/*.jar
- name: Run sh
run: sudo /home/ubuntu/mma/run.sh