Skip to content

Infra CI - publish docker images #16

Infra CI - publish docker images

Infra CI - publish docker images #16

name: Infra CI - publish docker images
on:
workflow_dispatch:
inputs:
version:
type: string
description: "Custom tag to publish container image version"
required: true
jobs:
publish-images:
runs-on: ubuntu-22.04
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Login to container image repository
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build all images
run: scripts/build-all.sh ${{ inputs.version }}
- 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