Deploy to Docker Hub #306
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: 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 |