diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index be7280e..05cfd2e 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -33,8 +33,16 @@ jobs: - name: Build and tag docker image run: docker build -t ghcr.io/hyperion-project/${{ matrix.file }}:${{ matrix.tag }} --build-arg DIST=${{ matrix.dist }} --build-arg SUITE=${{ matrix.tag }} -f apt/${{ matrix.file }} . + - name: Check whether we should publsh to GitHub Container/Package Registry + 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 Registry + if: steps.enabledockerpublish.outputs.enabledockerpublish == 'true' run: | echo ${{ secrets.DOCKER_CI }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin docker push ghcr.io/hyperion-project/${{ matrix.file }}:${{ matrix.tag }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f77df71..5285b9a 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 we should publsh to GitHub Container/Package Registry + 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 }}