-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (34 loc) · 1.12 KB
/
deploy_dockerhub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 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