Skip to content

Commit f340293

Browse files
committed
add workflows and README
1 parent a373399 commit f340293

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

.github/workflows/build-push.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Create and publish a Docker image
2+
3+
# Configures this workflow to run every time a change is pushed to the branch called `release`.
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*.*.*"
10+
paths-ignore:
11+
- '**/README.md'
12+
pull_request:
13+
14+
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
15+
env:
16+
REGISTRY: ghcr.io
17+
IMAGE_NAME: substratusai/verba
18+
19+
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
20+
jobs:
21+
build-and-push-image:
22+
runs-on: ubuntu-latest
23+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
24+
permissions:
25+
contents: read
26+
packages: write
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
31+
- name: Log in to the Container registry
32+
if: github.event_name == 'push'
33+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Login to docker.io
40+
if: github.event_name == 'push'
41+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
42+
with:
43+
username: ${{ vars.DOCKERHUB_USERNAME }}
44+
password: ${{ secrets.DOCKERHUB_TOKEN }}
45+
46+
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
47+
- name: Extract metadata (tags, labels) for Docker
48+
id: meta
49+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
50+
with:
51+
images: |
52+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53+
${{ env.IMAGE_NAME }}
54+
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
55+
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
56+
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
57+
- name: Build and push Docker image
58+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
59+
with:
60+
context: .
61+
push: ${{ github.event_name == 'push' }}
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Create GitHub Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Release pushed tag
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- name: Create release
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
tag: ${{ github.ref_name }}
20+
run: |
21+
gh release create "$tag" \
22+
--repo="$GITHUB_REPOSITORY" \
23+
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
24+
--generate-notes

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Verba Docker Image
2+
3+
This is a Docker image that publishes versioned images of Weaviate Verba.
4+
5+
Image are published to the following locations:
6+
- Docker Hub: `substratusai/verba`
7+
- GitHub Container Registry: `ghcr.io/substratusai/verba`
8+
9+
Checkout the releases to see what versions are available.

0 commit comments

Comments
 (0)