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
# This workflow will build, test and push the latest version on the beta environment. | |
on: | |
push: | |
branches: | |
- 'main' | |
name: 🔘 Beta - Build, Test and publish | |
jobs: | |
deploy: | |
name: beta-test-build-publish | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
############################################ | |
# TODO 2 Issue | |
########################################### | |
- name: "TODO2Issue" | |
uses: "alstr/todo-to-issue-action@v4" | |
with: | |
IDENTIFIERS: '[{"name": "ISSUE", "labels": ["codeTodo"]}]' | |
############################################ | |
# Install Java | |
########################################### | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
############################################ | |
# Install Maven dependency submission | |
########################################### | |
- name: Maven Dependency Tree Dependency Submission | |
uses: advanced-security/[email protected] | |
############################################ | |
# Maven build and testing | |
########################################### | |
- name: Build and test with Maven | |
run: mvn --batch-mode --update-snapshots install | |
############################################ | |
# Deploy api JAR to qualification environment | |
########################################### | |
- name: Deploy API to qualification server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
ARGS: "-rltgoDzvO --delete" | |
SOURCE: "/api/target/api-0.0.1-SNAPSHOT.jar" | |
REMOTE_HOST: ${{ secrets.REMOTE_BETA_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_BETA_USER }} | |
TARGET: "/opt/open4goods/bin/latest/api-latest.jar" | |
############################################ | |
# Deploy ui JAR to qualification environment | |
########################################### | |
- name: Deploy UI to qualification server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
ARGS: "-rltgoDzvO --delete" | |
SOURCE: "/ui/target/ui-0.0.1-SNAPSHOT.jar" | |
REMOTE_HOST: ${{ secrets.REMOTE_BETA_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_BETA_USER }} | |
TARGET: "/opt/open4goods/bin/latest/ui-latest.jar" | |
############################################ | |
# Restarting application | |
########################################### | |
- name: Publish applications | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.REMOTE_BETA_HOST }} | |
username: ${{ secrets.REMOTE_BETA_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY}} | |
script: sh /opt/open4goods/bin/publish-jars.sh | |