Skip to content

create-and-release-web-apps #32

create-and-release-web-apps

create-and-release-web-apps #32

name: "create-and-release-web-apps"
# permissions:
# actions: write
# packages: write
# contents: write
on:
push:
branches: ["not-existent-main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Build with dotnet
run: dotnet build frontend/frontend.csproj --configuration Release
- name: dotnet publish
run: dotnet publish frontend/frontend.csproj -c Release -o ${{env.DOTNET_ROOT}}/frontend
- name: Build with dotnet
run: dotnet build catalog/catalog.csproj --configuration Release
- name: dotnet publish
run: dotnet publish catalog/catalog.csproj -c Release -o ${{env.DOTNET_ROOT}}/catalog
- name: Build with dotnet
run: dotnet build ordering/ordering.csproj --configuration Release
- name: dotnet publish
run: dotnet publish ordering/ordering.csproj -c Release -o ${{env.DOTNET_ROOT}}/ordering
- name: Zip artifact for deployment
run: |
mkdir frontend-dist
cp ${{env.DOTNET_ROOT}}/frontend/* ./frontend-dist -r
cd frontend-dist
zip frontend.zip ./* -r
cd ..
mkdir ordering-dist
cp ${{env.DOTNET_ROOT}}/ordering/* ./ordering-dist -r
cd ordering-dist
zip ordering.zip ./* -r
cd ..
mkdir catalog-dist
cp ${{env.DOTNET_ROOT}}/catalog/* ./catalog-dist -r
cd catalog-dist
zip catalog.zip ./* -r
cd ..
- name: create a relase with version provided by package push
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.EXTENDED_ACCESSTOKEN }}"
tag_name: "v${{env.GitVersion_SemVer}}"
generate_release_notes: true
files: |
./ordering-dist/ordering.zip
./catalog-dist/catalog.zip
./frontend-dist/frontend.zip