forked from huggingface/text-generation-inference
-
Notifications
You must be signed in to change notification settings - Fork 46
56 lines (54 loc) · 1.6 KB
/
push_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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build and push docker image to Github registry
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag for the Docker image:'
required: true
jobs:
build-and-push:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
config-inline: |
[registry."docker.io"]
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
flavor: |
latest=true
images: ghcr.io/huggingface/tgi-gaudi
tags: |
type=raw,value=${{ github.event.inputs.tag }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
platforms: 'linux/amd64'
tags: ${{ steps.meta.outputs.tags }}