BuildDeploy FrontEnd #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: BuildDeploy FrontEnd | |
env: | |
APP_FOLDER_PATH: frontend | |
on: | |
push: | |
branches: main | |
paths: | |
- 'frontend/**' | |
workflow_dispatch: | |
jobs: | |
Build-Publish-Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get DateTime | |
run: echo "RUN_DT=$(TZ='America/New_York' date +'%m/%d/%Y %I:%M %p')" >> $GITHUB_ENV | |
- name: Print vars | |
run: | | |
echo ${{env.APP_FOLDER_PATH}} | |
echo "The date time for this run was: ${{env.RUN_DT}}" | |
- name: update build number from GH Action | |
uses: TomaszKandula/[email protected] | |
with: | |
files: '${{env.APP_FOLDER_PATH}}/appsettings.json' | |
env: | |
DeploymentDate: ${{env.RUN_DT}} | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore, Build, Test, Publish | |
run: | | |
cd ${{env.APP_FOLDER_PATH}} | |
dotnet restore | |
dotnet build --no-restore | |
dotnet test --no-build --verbosity normal | |
dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp | |
- name: Deploy App to Azure WebService | |
uses: Azure/[email protected] | |
with: | |
#app-name: 'Cocktail-Frontend' | |
publish-profile: ${{ secrets.COCKTAIL_FRONTEND_MCAPS_F25_PUBLISH_PROFILE }} | |
# Enter an existing Slot other than the Production slot | |
#slot-name: prod2 | |
# Applies to Web App only: Path to package or folder. *.zip, *.war, *.jar or a folder to deploy | |
package: ${{env.DOTNET_ROOT}}/myapp |