Skip to content

Commit

Permalink
Merge pull request #2 from sipcapture/feature/cd-deployment
Browse files Browse the repository at this point in the history
Github Action
  • Loading branch information
Dletta authored Dec 20, 2024
2 parents b74274c + 090539b commit 25f8a37
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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/[email protected]
with:
ref: ${{ github.ref }}

- name: Update Package to Release Version
uses: technote-space/[email protected]

- 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/[email protected]

- 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 }}

0 comments on commit 25f8a37

Please sign in to comment.