Skip to content

Commit

Permalink
Fix docker push logic
Browse files Browse the repository at this point in the history
was cut and pasted from datacube repo which uses different secret names
  • Loading branch information
Kirill888 committed Aug 25, 2021
1 parent 29d9774 commit a86c13d
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,18 @@ jobs:
&& github.repository == 'opendatacube/odc-tools'
run: |
if [ -n "${{ secrets.DockerPassword }}" ]; then
echo "Login to DockerHub as ${DOCKER_USER}"
echo "${{ secrets.DockerPassword }}" | docker login -u "${DOCKER_USER}" --password-stdin
if [ -n "${{ secrets.DOCKER_USER }}" ]; then
echo "Login to DockerHub as ${{ secrets.DOCKER_USER }}"
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USER }}" --password-stdin
echo "::set-output name=logged_in::yes"
else
echo "Set DockerPassword secret to push to docker"
echo "Set DOCKER_{PASSWORD,USER} secrets to push to docker"
echo "::set-output name=logged_in::no"
fi
- name: DockerHub Push
if: |
github.event_name == 'push'
&& github.ref == 'refs/heads/develop'
&& github.repository == 'opendatacube/odc-tools'
&& steps.dkr.outputs.logged_in == 'yes'
steps.dkr.outputs.logged_in == 'yes'
run: |
if [ -n "${{ secrets.DockerPassword }}" ]; then
docker push "${{ steps.cfg.outputs.docker_image }}"
fi
docker push "${{ steps.cfg.outputs.docker_image }}"

0 comments on commit a86c13d

Please sign in to comment.