# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  build-docker:
    runs-on: debian-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build Docker image
        run: |
          docker build -t git.mi6e4ka.dev/yabl/app:latest -f ./docker/Dockerfile .
      - name: Login to local Docker registry
        run: |
          echo ${{ secrets.REGISTRY_PASSWORD }} | docker login git.mi6e4ka.dev \
            --username ${{ secrets.REGISTRY_USERNAME }} \
            --password-stdin
      - name: Push image
        run: |
          docker push git.mi6e4ka.dev/yabl/app:latest 
