forked from fybrik/openmetadata-connector
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (43 loc) · 1.23 KB
/
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
name: Push
on:
push:
branches:
- 'main'
tags:
- '*'
env:
DOCKER_HOSTNAME: ghcr.io
DOCKER_NAMESPACE: fybrik
DOCKER_USERNAME: ${{ github.actor }}
GO_VERSION: 1.19
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v3
# Versions are created as follows:
# - Tags starting with v will be released as what comes after `v`. (e.g. refs/tags/v1.0 -> 1.0).
# - Main branch will be released with `main` as version tag for the docker images.
- id: version
name: Infer version
run: |
if [[ ${GITHUB_REF} == refs/tags/* ]] ;
then
version="${GITHUB_REF#refs/tags/v}"
elif [[ ${GITHUB_REF} == refs/heads/main ]] ;
then
version=main
fi
echo ::set-output name=version::$version
echo "DOCKER_TAG=${version}" >> $GITHUB_ENV
- name: Build docker image
run: make docker-build
- name: Docker push
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login -u "${{ env.DOCKER_USERNAME }}" --password-stdin "${{ env.DOCKER_HOSTNAME }}"
make docker-push