Skip to content

Commit

Permalink
feat: add dev and release docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed Apr 28, 2023
1 parent ad5d54c commit b07ab42
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
tags: runpod/serverless-hello-world:latest
tags: runpod/serverless-hello-world:dev
24 changes: 24 additions & 0 deletions .github/workflows/CD-docker_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Docker Image

on:
release:
types: [published]

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: runpod/serverless-hello-world:${{ github.event.release.tag_name }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

This repository is setup to automatically build and push a docker image to the GitHub Container Registry. You will need to add your DockerHub credentials `DOCKERHUB_USERNAME` & `DOCKERHUB_TOKEN` to the GitHub Secrets for this repository to enable this functionality.

You will need to update the `CD-docker_dev.yml` & `CD-docker_release.yml` files to include your DockerHub username and the name of the image you want to build. The `CD-docker_dev.yml` file will build the image and push it to the `dev` tag, while the `CD-docker_release.yml` file will build the image on releases and tag it with the release version.

## Best Practices

Models should be part of your docker image, this can be accomplished by either copying them into the image or downloading them during the build process.

If using the input validation utility from the runpod python package, create a `schemas` python file where you can define the schemas, then import that file into your `handler.py` file.

0 comments on commit b07ab42

Please sign in to comment.