Skip to content
# https://github.com/marketplace/actions/publish-docker
name: Deploy to dockerhub
on: [push, workflow_dispatch]
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
secrets-defined: ${{ steps.secret-check.outputs.defined }}
steps:
- name: Check for Secret availability
id: secret-check
shell: bash
run: |
if [ "${{ secrets.DOCKER_USERNAME }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
build:
name: Deploy to dockerhub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: git archive -v -o container/charliecloud/parpe_base/parpe.tar.gz --format=tar.gz HEAD
- name: Publish to Registry
if: needs.check-secret.outputs.secrets-defined == 'true'
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: dweindl/parpe
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: container/charliecloud/parpe_base/
dockerfile: Dockerfile
tag_names: true