name: Build and Push Docker Image on: push: branches: - main env: REGISTRY: git.unjx.de LATEST_IMAGE: ${{ env.REGISTRY }}/${{ github.repository }}:latest jobs: build: runs-on: self-hosted steps: - run: echo $${{ github.token }} | docker login --username flohoss --password-stdin ${{ env.REGISTRY }} - run: | docker build \ --build-arg V_GOLANG=${{ vars.V_GOLANG }} \ --build-arg V_NODE=${{ vars.V_NODE }} \ --build-arg V_ALPINE=${{ vars.V_ALPINE }} \ --tag ${{ env.LATEST_IMAGE }} \ --push . cleanup: runs-on: self-hosted needs: build steps: - run: | docker system prune -a -f