Skip to content

Merge branch 'master' of https://github.com/TechnologyEnhancedLearnin… #77

Merge branch 'master' of https://github.com/TechnologyEnhancedLearnin…

Merge branch 'master' of https://github.com/TechnologyEnhancedLearnin… #77

name: Deploy to GitHub Pages
on:
#push:
# branches: [ master ]
workflow_run:
workflows: ["Build BCL Package"] # Name of the workflow to trigger from.
types:
- completed
permissions:
contents: write
env:
BCL_Source: "https://nuget.pkg.github.com/phil-nhs/index.json"
BCL_Version: ${{ steps.get-latest-bcl-version.outputs.latest-version }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
# qqqq if doing one per branch it will need to find the branch version
- name: Set BCL Version to Latest NuGet Package Version
- id: get-latest-bcl-version
run: |
TOKEN="${{ secrets.GITHUB_TOKEN }}"
OWNER="Phil-NHS"
PACKAGE_NAME="TELBlazorComponentLibrary.GitPageBlazorWasm"
VERSION_JSON=$(curl -s -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github+json" "https://api.github.com/users/$OWNER/packages/nuget/packages/$PACKAGE_NAME/versions")
LATEST_VERSION=$(echo "$VERSION_JSON" | jq -r '.[0].name')
echo "latest-version=$LATEST_VERSION" >> $GITHUB_ENV
- name: Replace local environment variable in nuget config because cant provide it as a parameter
run: sed -i "s|%LocalPackagePath%|$BCL_Source|g" nuget.config
# - name: Restore dependencies
# run: dotnet restore
# Add your tests here if needed
# - name: Test qqqqTODO
# run: dotnet test --no-build --verbosity normal
- name: Publish client using client release .csproj logic
run: dotnet publish ./TestHostPrerenderWASM/TestHostPrerenderWASM.Client/TestHostPrerenderWASM.Client.csproj --configuration Release
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs # The folder the action should deploy
branch: gh-pages # The branch the action should deploy to