Skip to content

Deploy to Docker Hub #303

Deploy to Docker Hub

Deploy to Docker Hub #303

name: Deploy to Docker Hub
on:
workflow_run:
workflows: ["CI"]
branches: [main, dev, "v**"]
types: [completed]
jobs:
deploy:
name: Deploy Docker images to Docker Hub
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment:
name: Docker Hub
url: https://hub.docker.com/u/thmmniii
concurrency:
group: "docker-hub-deploy-${{ github.event.workflow_run.head_branch }}"
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
# use Previous Workflow ref
ref: ${{ github.event.workflow_run.head_branch }}
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Deploy Docker images to Dockerhub
run: bash ./scripts/ci/docker-deploy.sh ${{ github.event.workflow_run.head_branch }} true