diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f77df71..834b5e1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -46,8 +46,15 @@ jobs: - name: Build and tag docker image run: | docker build -t ghcr.io/hyperion-project/${{ matrix.dockerImage }}:${{ matrix.dockerTag }} --build-arg SUITE=${{ matrix.dockerTag }} -f ${{ matrix.dockerImage }} . - + - name: Check whether container scanning should be enabled + id: enabledockerpublish + env: + SECRET_DOCKER_CI: ${{ secrets.DOCKER_CI }} + run: | + echo "Enable docker publish: ${{ env.SECRET_DOCKER_CI != '' }}" + echo "::set-output name=enabledockerpublish::${{ env.SECRET_DOCKER_CI != '' }}" - name: Publish to GitHub Container/Package Registry + if: steps.enabledockerpublish.outputs.enabledockerpublish == 'true' run: | echo ${{ secrets.DOCKER_CI }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin docker push ghcr.io/hyperion-project/${{ matrix.dockerImage }}:${{ matrix.dockerTag }}