Skip to content

Merge pull request #3 from ricardona/users/ricardona/add-log-analytic… #21

Merge pull request #3 from ricardona/users/ricardona/add-log-analytic…

Merge pull request #3 from ricardona/users/ricardona/add-log-analytic… #21

Workflow file for this run

name: Build and deploy ASP.Net Core app to ACI
on:
push:
paths:
- "src/net-photo-gallery/**"
jobs:
build:
runs-on: ubuntu-latest
# Sets the permissions granted to the GITHUB_TOKEN for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Build with dotnet
run: dotnet build --configuration Release
working-directory: 'src/net-photo-gallery'
- name: dotnet publish
run: dotnet publish -c Release -o publish
working-directory: 'src/net-photo-gallery'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build only (non-master branches)
if: github.ref != 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: 'src/net-photo-gallery'
push: false
load: true
tags: ghcr.io/${{ github.repository_owner }}/photogallery:latest
- name: Build and push (master branch)
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: 'src/net-photo-gallery'
push: true
tags: ghcr.io/${{ github.repository_owner }}/photogallery:latest