ci: release docker in source only (#8971)

* ci: release docker in source only

* condition at job level

* condition over secrets

* Apply suggestions from code review

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

Co-authored-by: Tony <TonyRL@users.noreply.github.com>
This commit is contained in:
Yishuai Li 2022-02-04 05:55:40 -05:00 committed by GitHub
parent 36b4cc5baa
commit 596167541e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -12,8 +12,20 @@ on:
- 'yarn.lock'
jobs:
check-env:
runs-on: ubuntu-latest
outputs:
check-docker: ${{ steps.check-docker.outputs.defined }}
steps:
- id: check-docker
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
if: ${{ env.DOCKER_USERNAME != '' }}
run: echo "::set-output name=defined::true"
release:
runs-on: ubuntu-latest
needs: check-env
if: needs.check-env.outputs.defined == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2