Merge pull request #10 from teambebop6/feature/add_florian_local #29
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: LargierJ build | |
on: | |
push: | |
branches: | |
- feature/* | |
- main | |
- main-* | |
env: | |
PUBLISH_BRANCH: main | |
jobs: | |
build-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
env: | |
CI: false | |
run: | | |
mvn -B package --file pom.xml | |
- name: Extract branch name | |
id: extract_branch | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
- name: Check publish branch information | |
id: check_publish | |
run: | | |
echo "Branch name is ${{ steps.extract_branch.outputs.branch }}" | |
echo "Publish branch name is $PUBLISH_BRANCH" | |
echo "Current branch should be published: ${{ env.PUBLISH_BRANCH == steps.extract_branch.outputs.branch }}" | |
echo "publish=${{ env.PUBLISH_BRANCH == steps.extract_branch.outputs.branch }}" >> $GITHUB_OUTPUT | |
- name: Publish | |
uses: nogsantos/scp-deploy@master | |
if: ${{ steps.check_publish.outputs.publish == 'true' }} | |
with: | |
src: ./largier-server/target/largier-run.jar | |
host: ${{ secrets.DEPLOY_HOST }} | |
remote: ${{ secrets.DEPLOY_DIR }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
user: ${{ secrets.DEPLOY_USER }} | |
key: ${{ secrets.DEPLOY_KEY }} |