Skip to content

Commit

Permalink
Revert to building outside, try oraclelinux:8-slim, disable docker …
Browse files Browse the repository at this point in the history
…buildx, try to fix envvar in cloud run deploy.
  • Loading branch information
ychescale9 committed Aug 14, 2024
1 parent c4b84ac commit 9026f45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ jobs:
steps:
- uses: actions/checkout@v4

# - uses: graalvm/setup-graalvm@v1
# with:
# distribution: 'graalvm-community'
# java-version: '22'
# github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm-community'
java-version: '22'
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: gradle/actions/setup-gradle@v4

# - name: Build GraalVM native executable
# run: ./gradlew nativeCompile --no-configuration-cache
- name: Build GraalVM native executable
run: ./gradlew nativeCompile --no-configuration-cache

- uses: docker/setup-buildx-action@v3
# - uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
Expand All @@ -85,13 +85,13 @@ jobs:

- name: Deploy to Cloud Run
run: |
gcloud run deploy $SERVICE_NAME \
--image $CONTAINER_IMAGE:latest \
--region $REGION \
--cpu $CPU \
--memory $MEMORY \
--timeout $REQUEST_TIMEOUT \
--min-instances $MIN_INSTANCES \
--max-instances $MAX_INSTANCES \
gcloud run deploy ${{ env.SERVICE_NAME }} \
--image ${{ env.CONTAINER_IMAGE }}:latest \
--region ${{ env.REGION }} \
--cpu ${{ env.CPU }} \
--memory ${{ env.MEMORY }} \
--timeout ${{ env.REQUEST_TIMEOUT }} \
--min-instances ${{ env.MIN_INSTANCES }} \
--max-instances ${{ env.MAX_INSTANCES }} \
--platform managed \
--allow-unauthenticated
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Build stage
FROM ghcr.io/graalvm/graalvm-community:22 as build
FROM docker.io/oraclelinux:8-slim

WORKDIR /app

COPY . .

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

# Runtime stage
FROM scratch

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

ENTRYPOINT ["/app/kstreamlined-backend"]

0 comments on commit 9026f45

Please sign in to comment.