Skip to content

fixing repo name in docker command #7

fixing repo name in docker command

fixing repo name in docker command #7

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
env:
REGISTRYNAME: nvg46g5woyax4mpnpreg.azurecr.io
REPOSITORYNAME: techboost/dotnetcoreapp
DOCKERFOLDERPATH: Application/src/RazorPagesTestSample
TAG: ${{ github.run_number }}
on:
push:
branches: [ "main", "feat/docker" ]
paths:
- 'Application/**/*'
- '.github/workflows/dotnet.yml'
pull_request:
branches: [ "main" ]
paths:
- 'Application/**/*'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./Application/src/RazorPagesTestSample
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
containerize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to ACR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRYNAME }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Docker build
shell: bash
run: |
docker build -t $REGISTRYNAME/$REPOSITORYNAME:$TAG -t $REGISTRYNAME/$REPOSITORYNAME:latest --build-arg build_version=$TAG $DOCKERFOLDERPATH
- name: Docker push
shell: bash
run: docker push $REGISTRYNAME/$REPOSITORYNAME:$TAG