name: Runner (dotnet)

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

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
      DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
      DOTNET_CLI_TELEMETRY_OPTOUT: 1
    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.101
    - name: Install dependencies
      run: dotnet restore ./dotnet
    - name: Build
      run: dotnet build ./dotnet --configuration Release --no-restore

name: Runner (dotnet)

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

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
      DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
      DOTNET_CLI_TELEMETRY_OPTOUT: 1
    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.101
    - name: Install dependencies
      run: dotnet restore ./dotnet
    - name: Build
      run: dotnet build ./dotnet --configuration Release --no-restore
    - name: Create docker iamge
      run: docker build ./dotnet/Dockerfile
    - name: Push docker image
      uses: kciter/aws-ecr-action@v1
      with:
        access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        account_id: ${{ secrets.AWS_ACCOUNT_ID }}
        repo: dotnet-services
        region: eu-west-2
        tags: latest,${{ github.sha }},${GITHUB_REF##*/}

Create and push docker image
Create and push docker image
