name: build and deploy docs

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]  

jobs:

  build:

    runs-on: ubuntu-latest

    env:
      DOCKER_HOST: tcp://localhost:2376
      DOCKER_TLS_VERIFY: "1"

    steps:
      - uses: actions/checkout@v3
      - name: Docker login
        run: docker login docker.dariusklein.nl -p ${{secrets.docker_password}} -u ${{secrets.docker_username}}
      - name: Build the Docker image
        run: docker build . --tag docker.dariusklein.nl/klein-projects/klein-docs:latest
      - name: Docker push
        run: docker push docker.dariusklein.nl/klein-projects/klein-docs:latest