-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.27 KB
/
docker.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Docker Build and Push to GHCR
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-22.04
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
- name: Push Docker image
if: github.event_name == 'push'
run: |
docker push ghcr.io/${{ github.repository }}:latest
docker build -t ${{ secrets.DOCKER_USERNAME }}/horus_inference_server:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/horus_inference_server:latest