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
on: workflow_dispatch | |
name: Prod - Create a release, publish the documentation, and deploy the binaries | |
jobs: | |
release: | |
name: prod-release-deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
############################################ | |
# Install Java | |
########################################### | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'adopt' | |
cache: maven | |
############################################ | |
# Build jars | |
########################################### | |
- name: Build jars with Maven | |
run: mvn --batch-mode --update-snapshots install -Dmaven.test.skip=true | |
############################################ | |
# Build maven site | |
########################################### | |
# - name: Build Maven site | |
# run: mvn --batch-mode clean site site:stage scm-publish:publish-scm | |
############################################ | |
# Build the changelogs | |
########################################### | |
# - name: Build Changelog | |
# id: github_release | |
# uses: mikepenz/release-changelog-builder-action@v3 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
############################################ | |
# Create the release | |
########################################### | |
# - name: Create Release | |
# uses: mikepenz/[email protected] #softprops/action-gh-release | |
# with: | |
# body: ${{steps.github_release.outputs.changelog}} | |
############################################ | |
# Deploy API to production server | |
########################################### | |
- name: Deploy API to 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_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: "/opt/open4goods/bin/latest/api-latest.jar" | |
############################################ | |
# Deploy UI to production server | |
########################################### | |
- name: Deploy UI to production 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_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: "/opt/open4goods/bin/latest/ui-latest.jar" | |
############################################ | |
# Restart applications | |
########################################### | |
- name: Publish applications | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY}} | |
script: sh /opt/open4goods/bin/publish-jars.sh | |