docker-github #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker-github | |
on: | |
workflow_dispatch | |
jobs: | |
deploy_to_docker: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
#- kinesis | |
- kafka | |
include: | |
- suffix: "" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: coursier/cache-action@v6 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'corretto' | |
- name: Docker:stage | |
run: sbt "project ${{ matrix.platform }}" docker:stage | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ matrix.platform }}/target/docker/stage | |
file: ${{ matrix.platform }}/target/docker/stage/Dockerfile | |
tags: ghcr.io/${{ github.repository }}/opensnowcat-collector-${{ matrix.platform }}:latest | |
push: true | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ matrix.platform }}/target/docker/stage | |
file: ${{ matrix.platform }}/target/docker/stage/Dockerfile | |
platforms: linux/amd64 | |
tags: oyermolaiev/opensnowcat-collector-snapshot-${{ matrix.platform }}${{ matrix.suffix }} | |
push: true |