Skip to content

Commit

Permalink
Only try to publush docker images if secrets.DOCKER_CI is set
Browse files Browse the repository at this point in the history
  • Loading branch information
nurikk-sa committed Mar 26, 2023
1 parent 9fdf416 commit ea38f50
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit ea38f50

Please sign in to comment.