From 60db7a47206b8fcc39799dfd08f2b7da50390c67 Mon Sep 17 00:00:00 2001 From: Ivan Yaremenchuk Date: Sun, 3 Apr 2022 21:39:49 +0200 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4be5a0a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + deploy-to-github-pages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0.x' + - name: Publish .NET Core Project + run: dotnet publish -c Release -o release --nologo + - name: Change base-tag in index.html from / to BlazorGitHubPagesDemo + run: sed -i 's///g' release/wwwroot/index.html + - name: copy index.html to 404.html + run: cp release/wwwroot/index.html release/wwwroot/404.html + - name: Add .nojekyll file + run: touch release/wwwroot/.nojekyll + - name: Commit wwwroot to GitHub Pages + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: release/wwwroot