Upload to DockerHub #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload to DockerHub | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Git tag to checkout | |
default: "" | |
required: false | |
publish: | |
description: Make Public(true or false) | |
default: "false" | |
required: true | |
jobs: | |
Upload: | |
runs-on: ubuntu-latest | |
steps: | |
# check users permission | |
- name: "Check Permissions" | |
uses: "lannonbr/[email protected]" | |
with: | |
permission: "admin" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone Repository | |
uses: actions/checkout@v2 | |
- name: Build Docker Container with Tag | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' | |
run: | | |
cd Docker | |
sudo docker build --tag brainflow/brainflow:${VERSION} --build-arg checkout_id=${VERSION} . | |
env: | |
VERSION: ${{ github.event.inputs.version }} | |
- name: Build Docker Container without Tag | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version == '' | |
run: | | |
cd Docker | |
sudo docker build --tag brainflow/brainflow:0.0.1 . | |
- name: Check Images | |
run: sudo -H docker images | |
- name: DockerHub Login | |
run: sudo -H docker login --username=brainflow --password ${DOCKERHUB_PASSWORD} | |
env: | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: DockerHub Push | |
if: github.event.inputs.publish == 'true' | |
run: sudo -H docker push brainflow/brainflow:${VERSION} | |
env: | |
VERSION: ${{ github.event.inputs.version }} |