Add Spring profile to enable/disable Service Discovery on startup #46
Workflow file for this run
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: Java CI with Maven | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
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: Create settings.xml | |
uses: s4u/maven-settings-action@v2.8.0 | |
with: | |
servers: '[{"id": "github", "username": "${{ secrets.TA_USERNAME }}", "password": "${{ secrets.TA_PASSWORD }}"}]' | |
- name: Build with Maven | |
run: mvn clean install -s /home/runner/.m2/settings.xml spring-boot:repackage | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
server-id: github | |
- name: Publish to GitHub Packages Apache Maven | |
run: mvn deploy | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Extract Maven project version | |
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) | |
id: project | |
- name: Check contents of target folder | |
run: ls target | |
- name: Docker Login | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build & push docker container | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: . | |
tags: ghcr.io/scai-bio/sam:latest, ghcr.io/scai-bio/sam:${{ steps.project.outputs.version }} |