Skip to content

Merge pull request #18 from Daniel-Andarge/task-3 #2

Merge pull request #18 from Daniel-Andarge/task-3

Merge pull request #18 from Daniel-Andarge/task-3 #2

Workflow file for this run

name: Build and Push Docker Image with Models
on:
push:
branches: [ "main" ]
paths:
- 'models/**'
env:
DOCKER_REGISTRY: docker.io
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IMAGE_NAME: ${{ github.repository_owner }}/${{ github.event.repository.name }}
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Copy Models to Build Context
run: |
mkdir -p ./build/models
cp -r ./models/* ./build/models/
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./build
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest