devops: fixed the auto-push-docker workflow, correct docker hub #3
Workflow file for this run
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: Create Docker Images | ||
# Create Docker images tagged based off commit | ||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_PASSWORD: | ||
required: true | ||
# workflow_dispatch: | ||
push: | ||
# branches: | ||
# - 'master' | ||
# pull_request: | ||
# branches: | ||
# - 'master' | ||
jobs: | ||
build_search: | ||
name: Building Search Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker metadata | ||
id: metadata | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.IMG_NAME }} | ||
tags: | | ||
type=raw,value={{sha}},enable=${{ github.ref_type != 'tag' }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | ||
with: | ||
context: search/ | ||
file: ./Dockerfile | ||
push: true | ||
labels: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||