Merge pull request #922 from FederatedAI/develop-2.0.0-beta #31
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
name: Push kubefate service image to DockerHub | |
on: | |
push: | |
# Publish `master` as Docker `latest` image. | |
branches: | |
- master | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
jobs: | |
# no test is required | |
push: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Prepare the TAG | |
id: prepare-the-tag | |
run: | | |
# strip git ref prefix from version | |
TAG="" | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
if [ $VERSION = "master" ]; then | |
TAG="latest" | |
fi | |
echo "::set-output name=tag::$TAG" | |
- name: Build image | |
run: | | |
VERSION=${{steps.prepare-the-tag.outputs.tag}} | |
if [ ! -z "$VERSION" ]; then | |
export VERSION | |
fi | |
cd k8s-deploy | |
make docker-build-without-test | |
- name: Log into DockerHub | |
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push image | |
run: | | |
VERSION=${{steps.prepare-the-tag.outputs.tag}} | |
if [ ! -z "$VERSION" ]; then | |
export VERSION | |
fi | |
cd k8s-deploy | |
make docker-push |