Skip to content

Commit

Permalink
Merge branch 'develop' into at-units-in-multiple-languages
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima committed Jul 30, 2024
2 parents 0595b6d + d6f5cf5 commit 9fd9869
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-docker-image-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish api-server Docker image to DockerHub

on:
workflow_dispatch:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: wiseberkeley/wise-api-server
flavor: latest=true
tags: |
type=semver,pattern={{version}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
14 changes: 9 additions & 5 deletions .github/workflows/maven.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven
name: Build API and release on GitHub
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
java-version: 1.8
node-version: 20
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Release
Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM maven:3.9.6-eclipse-temurin-17
# Generate wise-api-server Docker image

# Stage 1: Build application
FROM maven:3.9.6-eclipse-temurin-17 as build
WORKDIR /app
COPY . .
RUN mvn package

COPY pom.xml .
RUN mvn dependency:go-offline

COPY src/ /app/src/

CMD mvn spring-boot:run -Dspring-boot.run.profiles=dockerdev
# Stage 2: Copy war
FROM eclipse-temurin:17
COPY --from=build /app/target/wise.war wise.war
ENTRYPOINT ["java","-jar","/wise.war", "--spring.config.location=/application.properties"]
8 changes: 8 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generate wise-api-dev Docker image

FROM maven:3.9.6-eclipse-temurin-17
WORKDIR /app
COPY pom.xml .
RUN mvn dependency:go-offline
COPY src/ /app/src/
CMD mvn spring-boot:run -Dspring-boot.run.profiles=dockerdev

0 comments on commit 9fd9869

Please sign in to comment.