diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1b9df5a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,51 @@ +name: blazorwasm + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '7.0.x' + include-prerelease: true + + - name: Publish .NET Core Project + run: dotnet publish example.csproj -c Release -o release --nologo + working-directory: ./example + + - name: Change base-tag in index.html from / to Razor-Barcode-Library + run: sed -i 's///g' release/wwwroot/index.html + working-directory: ./example + + - name: copy index.html to 404.html + run: cp release/wwwroot/index.html release/wwwroot/404.html + working-directory: ./example + + - name: Add .nojekyll file + run: touch release/wwwroot/.nojekyll + working-directory: ./example + + - 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: example/release/wwwroot