Skip to content

Initial Working Release #1

Initial Working Release

Initial Working Release #1

name: Build docker container and push to dockerhub
on:
release:
types: [published]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Release Version Tag (0.0.0)'
required: true
jobs:
build:
runs-on: ubuntu-latest
name: 'Build container and push'
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
with:
ref: ${{ github.ref }}
- name: Update Package to Release Version
uses: technote-space/package-version-check-action@v1.9.3
- name: Check Docker secret presence
id: checkdocker
shell: bash
run: |
if [ "$SECRET" == "" ]; then
echo "secretspresent=false" >> $GITHUB_OUTPUT
else
echo "secretspresent=true" >> $GITHUB_OUTPUT
fi
env:
SECRET: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/setup-buildx-action@v3.0.0
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/build-push-action@v6
with:
context: "."
push: true
tags: |
qxip/expsuehep:latest
qxip/expsuehep:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}