forked from ai-hero/llm-research-fine-tuning
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 1.05 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Docker Image Creation
on: [push]
jobs:
build:
runs-on: large-runner
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set short git commit SHA
id: short_sha
run: |
echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: aihero/${{ github.event.repository.name }}:${{ env.SHORT_SHA }}
cache-from: type=registry,ref=aihero/${{ github.event.repository.name }}:buildcache
cache-to: type=registry,ref=aihero/${{ github.event.repository.name }}:buildcache,mode=max