Skip to content

Commit

Permalink
WIP - compile native image, build docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Aug 13, 2024
1 parent 4749ac0 commit 971a715
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,27 @@ jobs:
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- run: ./gradlew assemble check --no-configuration-cache
deploy:
name: Build and push container image to Google Artifact Registry, deploy to Cloud Run
# needs: [ assemble-and-check ]
# if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm-community'
java-version: '22'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: gradle/actions/setup-gradle@v4
- name: Compile GraalVM native image
run: ./gradlew nativeCompile --no-configuration-cache
- uses: docker/setup-buildx-action@v3
# TODO login to GAR
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: false # TODO push
tags: ${{env.GITHUB_SHA}}
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Build stage
FROM ghcr.io/graalvm/graalvm-community:22 as build

WORKDIR /app

COPY . /app

RUN ./gradlew nativeCompile --no-configuration-cache

# Runtime stage
FROM scratch

COPY --from=build /app/build/native/nativeCompile/kstreamlined-backend /app
COPY build/native/nativeCompile/kstreamlined-backend /app/kstreamlined-backend

ENTRYPOINT ["/app/"]
ENTRYPOINT ["/app/kstreamlined-backend"]

EXPOSE 8000

0 comments on commit 971a715

Please sign in to comment.