From 9a61438870c3e18eae6325637efc71c5cd6f727e Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Sat, 10 Apr 2021 16:54:24 +0200 Subject: [PATCH] Automate Docker push --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d46441d0e..d65461c60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,3 +40,30 @@ jobs: asset_path: server/target/kroki-server.jar asset_name: kroki-server-${{ env.RELEASE_VERSION }}.jar asset_content_type: application/zip + publish_dockerhub: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - name: Set up JDK 11 + uses: actions/setup-java@v1.4.3 + with: + java-version: 11 + - name: Install Java dependencies + run: make installLocalDependencies + - name: Build Java server + run: make buildServer + - name: Setup Docker + # taken from https://github.com/docker/github-actions/blob/0f18e2abad9a4ac2963d2516246787375b5ec917/Dockerfile#L32 + run: curl -fL https://download.docker.com/linux/static/stable/x86_64/docker-20.10.4.tgz | tar xzO docker/docker > docker && sudo mv -f docker /usr/bin/docker && sudo chmod +x /usr/bin/docker + - name: Build Docker images + run: make buildDockerImages + - name: Release Docker images + run: make releaseDockerImages + - name: Login to Docker Hub + run: | + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + - name: Push Docker images + run: make pushDockerImages