on:
  workflow_dispatch:
  push:
    branches: [ datree-scoring ]
env:
  DATREE_TOKEN: ${{ secrets.DATREE_TOKEN }} 
jobs:
  k8sPolicyCheck:
    runs-on: ubuntu-latest

    steps:
      - name: checkout
        uses: actions/checkout@v2
      - name: run datree policy check
        uses: datreeio/action-datree@main
        with:
          path: 'kubernetes/datree/example/deployment.yaml'
          cliArguments: '--only-k8s-files'
      - name: docker login
        env:
          DOCKER_USER: ${{ secrets.DOCKER_USER }}   
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}  
        run: |
          docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
      - name: build
        run: |
          docker build ./c# -t aimvector/csharp:1.0.0
      - name: push
        run: |
          docker push aimvector/csharp:1.0.0
      - name: deploy
        run: |
          echo 'deploying...'