Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
404ed7a1
Unverified
Commit
404ed7a1
authored
Jan 31, 2023
by
OlivierDehaene
Committed by
GitHub
Jan 31, 2023
Browse files
feat(ci): Docker build and push (#46)
parent
f830706b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
.github/workflows/build.yaml
.github/workflows/build.yaml
+58
-0
No files found.
.github/workflows/build.yaml
0 → 100644
View file @
404ed7a1
name
:
Build and push docker image to internal registry
on
:
workflow_dispatch
:
push
:
branches
:
-
'
main'
pull_request
:
branches
:
-
'
main'
jobs
:
build-and-push-image
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Tailscale
uses
:
tailscale/github-action@v1
with
:
authkey
:
${{ secrets.TAILSCALE_AUTHKEY }}
-
name
:
Checkout repository
uses
:
actions/checkout@v3
-
name
:
Inject slug/short variables
uses
:
rlespinasse/github-slug-action@v4
-
name
:
Login to GitHub Container Registry
uses
:
docker/login-action@v2
with
:
registry
:
ghcr.io
username
:
${{ github.actor }}
password
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Login to internal Container Registry
uses
:
docker/login-action@v2.1.0
with
:
username
:
${{ secrets.TAILSCALE_DOCKER_USERNAME }}
password
:
${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
registry
:
registry.internal.huggingface.tech
-
name
:
Extract metadata (tags, labels) for Docker
id
:
meta
uses
:
docker/metadata-action@v4.3.0
with
:
flavor
:
|
latest=auto
images
:
|
ghcr.io/huggingface/text-generation-inference
registry.internal.huggingface.tech/api-inference/community/text-generation-inference
tags
:
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}
-
name
:
Build and push Docker image
uses
:
docker/build-push-action@v2
with
:
context
:
.
file
:
Dockerfile
push
:
${{ github.event_name != 'pull_request' }}
platforms
:
'
linux/amd64'
tags
:
${{ steps.meta.outputs.tags }}
labels
:
${{ steps.meta.outputs.labels }}
cache-from
:
type=registry,ref=ghcr.io/huggingface/text-generation-inference:latest
cache-to
:
type=inline
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment