Skip to content

Commit d2d31a3

Browse files
authored
Publish docker image on github container registry (#95)
1 parent 77bde06 commit d2d31a3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/scripts/docker/DockerFile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
FROM gcr.io/distroless/base-debian10
22
ADD scala /usr/local/bin/scala
3+
LABEL org.opencontainers.image.source="https://github.com/virtuslabrnd/scala-cli"
34
ENTRYPOINT ["/usr/local/bin/scala"]

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
jvm: 8
103103
- name: Generate native launcher
104104
run: ./mill -i show cli-core.nativeImageMostlyStatic
105-
- name: Generate docker image
105+
- name: Build docker image
106106
run: .github/scripts/generate-docker-images-ubuntu.sh
107107
- name: Copy artifacts
108108
run: ./mill -i copyMostlyStaticLauncher artifacts/
@@ -116,6 +116,18 @@ jobs:
116116
run: ./mill -i integration-core.native-mostly-static.test
117117
- name: Docker integration tests
118118
run: ./mill integration.docker.test
119+
- name: Login to GitHub Container Registry
120+
if: github.event_name == 'push'
121+
uses: docker/login-action@v1
122+
with:
123+
registry: ghcr.io
124+
username: ${{ github.actor }}
125+
password: ${{ secrets.GITHUB_TOKEN }}
126+
- name: Push scala-cli to github container registry
127+
if: github.event_name == 'push'
128+
run: |
129+
docker tag scala-cli ghcr.io/virtuslabrnd/scala-cli:latest
130+
docker push ghcr.io/virtuslabrnd/scala-cli:latest
119131
120132
native-static-tests:
121133
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)