Skip to content

Bump the actions group with 4 updates #222

Bump the actions group with 4 updates

Bump the actions group with 4 updates #222

name: AIForOrcas.Client.Web
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch: # Allow manual workflow invocation from the Github Actions UI
env:
DOTNET_VERSION: 6.0.x
DOTNET_RUNTIME: win-x86
WORKING_DIR: ModeratorFrontEnd/AIForOrcas/AIForOrcas.Client.Web
PUBLISH_DIR: output
AZURE_APP_NAME: AIForOrcas
defaults:
run:
working-directory: ModeratorFrontEnd/AIForOrcas/AIForOrcas.Client.Web
permissions: # added using https://github.com/step-security/secure-repo
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
src:
- ModeratorFrontEnd/AIForOrcas/AIForOrcas.Client.Web/**
- ModeratorFrontEnd/AIForOrcas/AIForOrcas.Client.BL/**
- ModeratorFrontEnd/AIForOrcas/AIForOrcas.Server.BL/**
- ModeratorFrontEnd/AIForOrcas/AIForOrcas.DTO/**
- .github/workflows/AIForOrcas.Client.Web.yaml
build:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
permissions:
contents: read
steps:
- uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET Core
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Dependencies
run: dotnet restore -r ${{ env.DOTNET_RUNTIME }}
- name: Build
run: dotnet build --no-restore -c Release -r ${{ env.DOTNET_RUNTIME }}
- name: Test
run: dotnet test --no-restore -r ${{ env.DOTNET_RUNTIME }}
- name: Publish
run: dotnet publish --no-restore -c Release -o './${{ env.PUBLISH_DIR }}'
- name: Artifacts cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}
key: ${{ github.sha }}-${{ env.AZURE_APP_NAME }}-${{ env.DOTNET_RUNTIME }}-artifacts
deploy:
if: github.ref == 'refs/heads/main' && needs.changes.outputs.src == 'true'
runs-on: ubuntu-latest
needs:
- changes
- build
permissions:
contents: read
steps:
- uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
with:
egress-policy: audit
- name: Artifacts cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ./${{ env.WORKING_DIR}}/${{ env.PUBLISH_DIR }}
key: ${{ github.sha }}-${{ env.AZURE_APP_NAME }}-${{ env.DOTNET_RUNTIME }}-artifacts
- name: Deploy to azure
uses: azure/webapps-deploy@657f0700ea5214d56a0400d8ac5e8023c963d25d # v3.0.6
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_AISFORORCAS_PUBLISH_PROFILE }}
package: ./${{ env.WORKING_DIR }}/${{ env.PUBLISH_DIR }}