diff --git a/.github/workflows/build-trainer.yaml b/.github/workflows/build-trainer.yaml new file mode 100644 index 0000000..3b35624 --- /dev/null +++ b/.github/workflows/build-trainer.yaml @@ -0,0 +1,43 @@ +name: Build DDI Trainer Image + +on: + push: + paths: + - 'components/runpod_trainer/**' + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ghndrx/ddi-trainer + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./components/runpod_trainer + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max