-
Notifications
You must be signed in to change notification settings - Fork 221
51 lines (44 loc) · 1.26 KB
/
kubefate-push.yml
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
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