Skip to content

Commit

Permalink
Reduce the Images Size
Browse files Browse the repository at this point in the history
1. Update script to reduce the size of images by splitting nn and non-nn.
2. Add github action workflow to build and push images on master changed or tagged.

Signed-off-by: jiahaoc <[email protected]>
  • Loading branch information
jiahaoc1993 committed Dec 15, 2020
1 parent 23ad848 commit 716d279
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 206 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker

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-latest
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: TAG=${{steps.prepare-the-tag.outputs.tag}} bash docker-build/build_cluster_docker.sh all

- name: Log into DockerHub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push image
run: TAG=${{steps.prepare-the-tag.outputs.tag}} bash docker-build/build_cluster_docker.sh push
Loading

0 comments on commit 716d279

Please sign in to comment.