-
Notifications
You must be signed in to change notification settings - Fork 1
31 lines (29 loc) · 1021 Bytes
/
build_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
name: Build & Push Image
on:
push:
tags:
- 'v*.*'
jobs:
build_and_push_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get latest tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Print latest tag
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Login to github registry
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Build :tag ${{ env.RELEASE_VERSION }}
if: success()
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/get-keycloak-docs:${{ env.RELEASE_VERSION }} .
- name: Push to docker hub :tag ${{ env.RELEASE_VERSION }}
if: success()
uses: actions-hub/docker@master
with:
args: push ${{ secrets.DOCKER_USERNAME }}/get-keycloak-docs:${{ env.RELEASE_VERSION }}