Deploy wasm version to Pages #20
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: Deploy wasm version to Pages | |
on: | |
workflow_dispatch: | |
env: | |
PROJECT_PATH: ./BugFablesSaveEditor/BugFablesSaveEditor.Browser | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: | |
7.0.x | |
- name: Install wasm-tools | |
run: dotnet workload install wasm-tools-net7 wasm-experimental | |
- name: Install DotNetCompress | |
run: dotnet tool install --global DotNetCompress | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build | |
- name: Publish | |
working-directory: ${{ env.PROJECT_PATH }} | |
run: dotnet publish -f net8.0 | |
- name: Prepare AppBundle Directory | |
working-directory: ${{ env.PROJECT_PATH }}/bin/Release/browser-wasm/AppBundle | |
run: rm *.map | |
- name: Compress Output | |
run: DotNetCompress -d ${{ env.PROJECT_PATH }}/bin/Release/browser-wasm/AppBundle --format gz | |
- name: Fix permissions | |
shell: sh | |
run: | | |
chmod -c -R +rX "${{ env.PROJECT_PATH }}/bin/Release/browser-wasm/AppBundle" | | |
while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ${{ env.PROJECT_PATH }}/bin/Release/browser-wasm/AppBundle | |
deploy: | |
needs: build | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |