From 3727238be406590579152613e2742c7328180d3c Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Tue, 17 Nov 2020 17:05:58 +0100 Subject: [PATCH] Tweak labels --- .github/workflows/ci.yaml | 20 +++++++++++++++++--- .github/workflows/release.yaml | 6 ++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index be35a447b..c0ab66866 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,6 +57,14 @@ jobs: restore-keys: | ${{ runner.os }}-buildx- + # Log into docker hub if we're going to push the result + - name: Login to DockerHub + uses: docker/login-action@v1 + if: ${{ github.event_name != 'pull_request' }} + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + # Add Docker labels and tags - name: Docker meta id: docker_meta @@ -78,14 +86,20 @@ jobs: file: ./Dockerfile cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache,mode=max - load: true push: ${{ github.event_name != 'pull_request' }} # Push the master branch only + load: ${{ github.event_name == 'pull_request' }} # Otherwise, just load it locally tags: ${{ steps.docker_meta.outputs.tags }} # Use runtime labels from docker_meta as well as fixed labels labels: | ${{ steps.docker_meta.outputs.labels }} - org.opencontainers.image.authors="Joris Borgdorff , Lee Evans - www.ltscomputingllc.com" - org.opencontainers.image.vendor="OHDSI" + maintainer=Joris Borgdorff , Lee Evans - www.ltscomputingllc.com + org.opencontainers.image.authors=Joris Borgdorff , Lee Evans - www.ltscomputingllc.com + org.opencontainers.image.vendor=OHDSI + + # If the image was pushed, we need to pull it again to inspect it + - name: Pull image + if: ${{ github.event_name != 'pull_request' }} + run: docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} - name: Inspect image run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index acf83dc78..f8b306720 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -95,9 +95,11 @@ jobs: # Use runtime labels from docker_meta as well as fixed labels labels: | ${{ steps.docker_meta.outputs.labels }} - org.opencontainers.image.authors="Joris Borgdorff , Lee Evans - www.ltscomputingllc.com" - org.opencontainers.image.vendor="OHDSI" + maintainer=Joris Borgdorff , Lee Evans - www.ltscomputingllc.com + org.opencontainers.image.authors=Joris Borgdorff , Lee Evans - www.ltscomputingllc.com + org.opencontainers.image.vendor=OHDSI - name: Inspect image run: | + docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}