Skip to content

Commit

Permalink
Test usage of ghcr.io container registry for project builders
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Aug 21, 2024
1 parent 8618870 commit 79eb0bb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
15 changes: 8 additions & 7 deletions .github/actions/build-project/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,18 @@ runs:
run: |
echo "${{ inputs.github-key }}" > ${{ github.workspace }}/github_key
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ inputs.dockerhub-token }}
# - name: Login to Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ inputs.dockerhub-username }}
# password: ${{ inputs.dockerhub-token }}

- name: Build project
uses: addnab/docker-run-action@v3
if: steps.check-history.outputs.can-skip-build != 'true'
with:
image: "virtuslab/scala-community-build-project-builder:jdk${{ env.java-version }}-v0.3.15"
image: "ghcr.io/virtuslab/scala-community-build-project-builder:jdk${{ env.java-version }}-latest"
options: -v ${{ github.workspace }}:/opencb/ -v ${{ github.workspace }}/github_key:/root/.ssh/github_key:ro
run: |
# Setup ssh required for downloading submodules
Expand Down Expand Up @@ -212,7 +213,7 @@ runs:
uses: addnab/docker-run-action@v3
if: steps.check-history.outputs.can-skip-build != 'true'
with:
image: "virtuslab/scala-community-build-project-builder:jdk${{ env.java-version }}-latest"
image: "ghcr.io/virtuslab/scala-community-build-project-builder:jdk${{ env.java-version }}-latest"
options: -v ${{ github.workspace }}:/opencb/ -e ELASTIC_USERNAME=${{ inputs.elastic-user }} -e ELASTIC_PASSWORD=${{ inputs.elastic-password }}
run: |
ConfigFile="/opencb/.github/workflows/buildConfig.json"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,18 @@ jobs:

- name: Push images to image registry
run: scripts/publish-all.sh ${{ inputs.version }}

- name: Login to container image repository
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Publish to ghcr.io
run: |
for javaVersion in (8 11 17 21); do
imageName=virtuslab/scala-community-build-project-builder:jdk${javaVersion}-latest
docker tag $imageName ghcr.io/$imageName
docker push ghcr.io/$imageName
done
1 change: 1 addition & 0 deletions builder-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:22.04
LABEL org.opencontainers.image.source="https://github.com/VirtusLab/community-build3"

ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
2 changes: 1 addition & 1 deletion compiler-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM lampepfl/dotty:2021-03-22

LABEL org.opencontainers.image.source="https://github.com/VirtusLab/community-build3"
COPY . /build/
1 change: 1 addition & 0 deletions mvn-repo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM gradle:jdk11-hotspot
LABEL org.opencontainers.image.source="https://github.com/VirtusLab/community-build3"
WORKDIR /mvn-repo
COPY . /mvn-repo
EXPOSE 8080
Expand Down
1 change: 1 addition & 0 deletions project-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE
FROM $BASE_IMAGE
LABEL org.opencontainers.image.source="https://github.com/VirtusLab/community-build3"
RUN apt install -y jq
ENV PATH="/root/.local/share/coursier/bin:${PATH}"
RUN curl -fLo coursier https://github.com/coursier/launchers/raw/master/coursier && \
Expand Down

0 comments on commit 79eb0bb

Please sign in to comment.