mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-02 03:32:50 +08:00
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
name: push_docker
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- "**/*.py"
|
|
- "requirements.txt"
|
|
- "docker/**"
|
|
- ".github/workflows/*.yml"
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- "**/*.py"
|
|
- "requirements.txt"
|
|
- "docker/**"
|
|
- ".github/workflows/*.yml"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
environment:
|
|
name: docker
|
|
url: https://hub.docker.com/r/hiyouga/llamafactory
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./docker/docker-cuda/Dockerfile
|
|
build-args: |
|
|
EXTRAS=metrics,deepspeed,liger-kernel
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: docker.io/hiyouga/llamafactory:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|