forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 2.63 KB
/
Copy pathmaster_only.yml
File metadata and controls
67 lines (61 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: master only
on:
push:
branches: master
tags:
- 'v*.*.*'
jobs:
build-docker-images:
runs-on: [self-hosted]
strategy:
matrix:
component: [core, serving, jobcontroller, jupyter, ci]
env:
MAVEN_CACHE: gs://feast-templocation-kf-feast/.m2.2020-08-19.tar
steps:
- uses: actions/checkout@v2
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
export_default_credentials: true
- run: gcloud auth configure-docker --quiet
- name: Get m2 cache
run: |
infra/scripts/download-maven-cache.sh \
--archive-uri ${MAVEN_CACHE} \
--output-dir .
- name: Build image
run: make build-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: Push image
run: make push-${{ matrix.component }}-docker REGISTRY=gcr.io/kf-feast VERSION=${GITHUB_SHA}
- name: Push image to feast dev
run: |
if [ ${GITHUB_REF#refs/*/} == "master" ]; then
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:dev
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:dev
fi
- name: Get version
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
- name: Push versioned release
run: |
# Build and push semver tagged commits
rx='^v[0-9]+?\.[0-9]+?\.[0-9]+?$'
if [[ "${RELEASE_VERSION}" =~ $rx ]]; then
VERSION_WITHOUT_PREFIX=${RELEASE_VERSION:1}
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
# Also update "latest" image if tagged commit is pushed to stable branch
HIGHEST_SEMVER_TAG=$(git tag -l --sort -version:refname | head -n 1)
echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"
if [ "${VERSION_WITHOUT_PREFIX}" == "${HIGHEST_SEMVER_TAG:1}" ]
then
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:latest
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:latest
fi
fi
tests-docker-compose:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test docker compose
run: ./infra/scripts/test-docker-compose.sh