Skip to content

SECRETS to VARS

SECRETS to VARS #2

name: Publish Docker Image to Docker Hub
on:
push:
branches:
- main # Triggers the workflow on push to main branch; adjust as needed
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Check out the repository
uses: actions/checkout@v3
# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Build the docker image
- name: Build Docker image
run: |
docker build -t ${{ vars.DOCKER_USERNAME }}/hbcd_motion_postproc:latest .
# Push the Docker image to Docker Hub
- name: Push Docker image to Docker Hub
run: |
docker push ${{ vars.DOCKER_USERNAME }}/hbcd_motion_postproc:latest