Skip to content

Update maven-publish.yml #3

Update maven-publish.yml

Update maven-publish.yml #3

Workflow file for this run

on:
push:
branches:
- master
- localhost
pull_request:
branches:
- master
- localhost
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
- name: Build with Maven
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
mvn -B package --file backend/pom.xml
elif [ "${{ github.ref_name }}" == "localhost" ]; then
mvn -B package --file local_backend/pom.xml
fi
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}