Skip to content

Build test models

Build test models #17

name: Build test models
on: workflow_dispatch
# on:
# push:
# branches:
# - '**'
permissions:
contents: write
packages: write
checks: write
attestations: write
id-token: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
name: build test model
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.25.5'
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
go mod download
- name: download models
run: |
go run testcases/downloadModels.go
- name: List models directory
run: ls -l ./models
- name: Remove models from .dockerignore # make sure models folder is not ignored
run: sed -i '/^\/models$/d' .dockerignore
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: models.Dockerfile
tags: ghcr.io/knights-analytics/hugot/models:latest
push: true