2020-05-17 19:59:22 +02:00
|
|
|
name: Docker image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Build and push Docker image
|
|
|
|
env:
|
2021-09-10 10:08:03 +02:00
|
|
|
IMAGE_REPO: rchakode/hugo-mx-gateway
|
2020-05-17 19:59:22 +02:00
|
|
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
|
|
|
run: |
|
|
|
|
make build-ci
|
|
|
|
export GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
|
|
|
export IMAGE_TAG=$(echo $GIT_TAG | sed 's/v//')
|
|
|
|
docker build . --file Dockerfile --tag ${IMAGE_REPO}:${IMAGE_TAG}
|
|
|
|
docker tag ${IMAGE_REPO}:${IMAGE_TAG} ${IMAGE_REPO}:latest
|
|
|
|
echo "$REGISTRY_PASSWORD" | docker login -u $REGISTRY_USERNAME --password-stdin
|
2021-09-10 10:22:26 +02:00
|
|
|
docker push ${IMAGE_REPO}:${IMAGE_TAG}
|
2020-05-17 19:59:22 +02:00
|
|
|
docker push ${IMAGE_REPO}
|