-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from kimwnasptd/feature-kimwnasptd-mwa-manifests
Introduce GH action for building images with specific version
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Models web app Docker Publisher (Releasing) | ||
|
||
on: | ||
push: | ||
# Publish `master` as Docker `latest` image. | ||
branches: | ||
- master | ||
|
||
paths: | ||
- releasing/VERSION | ||
|
||
# Run tests for any PRs. | ||
pull_request: | ||
|
||
env: | ||
IMAGE_NAME: models-web-app | ||
|
||
jobs: | ||
# Run tests. | ||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/ | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run tests | ||
run: | | ||
docker build . --file Dockerfile | ||
# Push image to GitHub Packages. | ||
# See also https://docs.docker.com/docker-hub/builds/ | ||
push: | ||
# Ensure test job passes before pushing image. | ||
needs: test | ||
|
||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: | | ||
docker build . --file Dockerfile --tag ${IMAGE_NAME} | ||
- name: Log into registry | ||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_ID=kserve/$IMAGE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
VERSION=$(cat ./releasing/VERSION) | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Releasing | ||
|
||
This folder contains helper files for releasing the images and manifests of the | ||
web app. | ||
|
||
## Steps for releasing | ||
|
||
1. Create a new release branch | ||
``` | ||
VERSION="v0.7.0" | ||
RELEASE_BRANCH="release-0.7" | ||
git checkout -b $RELEASE_BRANCH origin/master | ||
``` | ||
2. Update the VERSION file with the corresponding tag | ||
3. Update the app's kustomization file to use the new tag | ||
4. Submit the PR | ||
5. Once merged the GH Action will tag and push an image based on the contents | ||
of the VERSION file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.7.0 |