Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
dockerfile, initial push to gcr workflow on tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
brsyuksel committed Jan 31, 2021
1 parent 393f6fb commit 7129329
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/push-to-gcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: push docker image to gcr

on:
create:
tags:
- '*'

jobs:
push-docker-image-to-gcr:
runs-on: ubuntu-latest
steps:
- name: get the version
id: get_tag_name
run: echo ::set-output name=GIT_TAG_NAME::${GITHUB_REF/refs\/tags\//}
- name: build then push to gcr
uses: RafikFarhad/push-to-gcr-github-action@v3
with:
gcloud_service_key: ${{ secrets.GC_GCR_SERVICE_KEY }}
registry: us.gcr.io
project_id: bilgge
image_name: bilgge-api
image_tag: ${{ steps.get_tag_name.outputs.GIT_TAG_NAME}},latest
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ghcr.io/graalvm/graalvm-ce:ol8-java8-21.0.0 AS builder

RUN cd /root && \
curl -L https://github.com/sbt/sbt/releases/download/v1.4.7/sbt-1.4.7.tgz --output sbt.tgz && \
tar xvf sbt.tgz && \
mv -v sbt /opt/sbt

ENV PATH="/opt/sbt/bin:${PATH}"

RUN mkdir /source
WORKDIR /source

COPY . .
RUN sbt packArchive

FROM ghcr.io/graalvm/graalvm-ce:ol8-java8-21.0.0

RUN mkdir /app
WORKDIR /app

COPY --from=builder /source/target/bilgge-0.1.0.tar.gz .
RUN tar xvf bilgge-0.1.0.tar.gz
RUN rm -v bilgge-*.tar.gz && mv -v bilgge-* bilgge && cd bilgge/bin

WORKDIR /app/bilgge/bin
CMD ./bilgge

0 comments on commit 7129329

Please sign in to comment.