-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
167 additions
and
130 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "Build" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
project_path: | ||
description: 'The project file path' | ||
required: true | ||
type: string | ||
project_version: | ||
description: 'The project version' | ||
required: true | ||
type: string | ||
project_output: | ||
description: "Path of the publish output directory" | ||
default: "publish" | ||
type: string | ||
|
||
jobs: | ||
build_website: | ||
name: Build | ||
runs-on: 'ubuntu-latest' | ||
env: | ||
NET_VERSION: '8.x' | ||
|
||
steps: | ||
- name: Download artifacts from the restore job | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: . | ||
|
||
# https://github.com/actions/setup-dotnet | ||
- name: Get .NET ${{ env.NET_VERSION }} externals | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.NET_VERSION }} | ||
dotnet-quality: 'ga' | ||
|
||
# https://github.com/dotnet/runtime/blob/main/src/mono/wasm/features.md | ||
- name: Install .NET WebAssembly workload | ||
run: dotnet workload install wasm-tools; | ||
# dotnet workload restore; | ||
|
||
- name: Version and publish the project | ||
run: dotnet publish ${{ inputs.project_path }} -c:Release -p:GHPages=true -p:Version=${{ inputs.project_version }} -o:${{ inputs.project_output }} --no-restore --nologo | ||
|
||
# "https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-8.0#github-pages" | ||
# "To deploy folders starting with underscore, add an empty .nojekyll file to the Git branch." | ||
- name: Add .nojekyll file | ||
run: touch "${{ inputs.project_output }}/wwwroot/.nojekyll" | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
|
||
# https://github.com/actions/upload-pages-artifact | ||
- name: Upload GitHub Pages artifact for web | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "${{ inputs.project_output }}/wwwroot" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "Build" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
artifact_name: | ||
description: 'Artifact name' | ||
default: 'github-pages' | ||
type: string | ||
outputs: | ||
page_url: | ||
description: 'The webpage URL' | ||
value: ${{ jobs.deploy_website.outputs.page_url }} | ||
|
||
jobs: | ||
deploy_website: | ||
name: Deploy App to GitHub Pages | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: ${{ inputs.artifact_name }} | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
outputs: | ||
page_url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
# Specify runner + deployment step | ||
runs-on: ubuntu-latest | ||
steps: | ||
# https://github.com/actions/deploy-pages | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "Restore" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
project_name: | ||
description: 'The name of the project' | ||
required: true | ||
type: string | ||
outputs: | ||
project_path: | ||
description: 'The project file path' | ||
value: ${{ jobs.restore.outputs.project_path }} | ||
|
||
jobs: | ||
restore: | ||
name: Build | ||
runs-on: 'ubuntu-latest' | ||
env: | ||
PROJECT_PATH: "./${{ inputs.project_name }}/${{ inputs.project_name }}.csproj" | ||
outputs: | ||
project_path: ${{ env.PROJECT_PATH }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# https://github.com/actions/setup-dotnet | ||
- name: Get .NET externals | ||
uses: actions/setup-dotnet@v4 | ||
|
||
- name: Restore project dependencies | ||
run: dotnet restore ${{ env.PROJECT_PATH }} | ||
|
||
# https://github.com/actions/upload-artifact | ||
- name: Upload version artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: . | ||
retention-days: 1 | ||
if-no-files-found: error # or 'ignore', defaults to `warn` |
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
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