@@ -69,36 +69,32 @@ jobs:
6969 export_default_credentials : true
7070 project_id : ${{ secrets.GCP_PROJECT_ID }}
7171 service_account_key : ${{ secrets.GCP_SA_KEY }}
72+ - run : gcloud auth configure-docker --quiet
7273 - name : Get m2 cache
7374 run : |
7475 infra/scripts/download-maven-cache.sh \
7576 --archive-uri ${MAVEN_CACHE} \
7677 --output-dir .
77- - name : Build and push
78- uses : docker/build-push-action@v2
79- env :
80- RELEASE_VERSION : ${{ needs.get-version.outputs.release_version }}
81- with :
82- push : true
83- context : .
84- file : ./infra/docker/${{ matrix.component }}/Dockerfile
85- tags : feastdev/feast-${{ matrix.component }}:${{ needs.get-version.outputs.release_version }}
86- build-args : |
87- REVISION=$RELEASE_VERSION
88- - name : Build and push latest
89- uses : docker/build-push-action@v2
78+ - name : Build and push versioned images
9079 env :
9180 RELEASE_VERSION : ${{ needs.get-version.outputs.release_version }}
9281 VERSION_WITHOUT_PREFIX : ${{ needs.get-version.outputs.version_without_prefix }}
9382 HIGHEST_SEMVER_TAG : ${{ needs.get-version.outputs.highest_semver_tag }}
94- with :
95- if : ${VERSION_WITHOUT_PREFIX} == ${HIGHEST_SEMVER_TAG:1}
96- push : true
97- context : .
98- file : ./infra/docker/${{ matrix.component }}/Dockerfile
99- tags : feastdev/feast-${{ matrix.component }}:latest
100- build-args : |
101- REVISION=$RELEASE_VERSION
83+ run : |
84+ docker build --build-arg VERSION=$RELEASE_VERSION \
85+ -t gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} \
86+ -t gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX} \
87+ -f infra/docker/${{ matrix.component }}/Dockerfile .
88+ docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
89+
90+ echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"
91+ if [ "${VERSION_WITHOUT_PREFIX}" = "${HIGHEST_SEMVER_TAG:1}" ]
92+ then
93+ docker tag feastdev/feast-${{ matrix.component }}:latest gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
94+ docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:latest gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
95+ docker push feastdev/feast-${{ matrix.component }}:latest
96+ docker push gcr.io/kf-feast/feast-${{ matrix.component }}:latest
97+ fi
10298
10399 publish-helm-charts :
104100 runs-on : ubuntu-latest
0 commit comments