Add Sok szerencsét! 2026
#118
This file contains hidden or 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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| deploy-to-github-pages: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout branch | |
| - name: Checkout branch | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| # Setup .NET SDK | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v5 | |
| # Install workloads | |
| - name: Install workloads | |
| run: dotnet workload restore src/ScratchcardStatistics/ScratchcardStatistics.csproj | |
| # Publish the Blazor project to the release folder | |
| - name: Publish Blazor project | |
| run: dotnet publish src/ScratchcardStatistics/ScratchcardStatistics.csproj -o release /p:Version=$(git rev-list --count HEAD) | |
| # Change the base tag in index.html from '/' to '/ScratchcardStatistics/' to match GitHub Pages repository subdirectory | |
| - name: Change base tag in index.html from '/' to '/ScratchcardStatistics/' | |
| run: sed -i 's/<base href="\/" \/>/<base href="\/ScratchcardStatistics\/" \/>/g' release/wwwroot/index.html | |
| # Copy index.html to 404.html to serve the same file when a file is not found | |
| - name: Copy index.html to 404.html | |
| run: cp release/wwwroot/index.html release/wwwroot/404.html | |
| # Add .nojekyll file to tell GitHub Pages to not treat this as a Jekyll project (allow files and folders starting with an underscore) | |
| - name: Add .nojekyll file | |
| run: touch release/wwwroot/.nojekyll | |
| # Add .gitattributes file to treat files as binary files | |
| - name: Add .gitattributes file | |
| run: echo "* binary" > release/wwwroot/.gitattributes | |
| # Commit the published project files to GitHub Pages branch | |
| - name: Commit files to GitHub Pages branch | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: gh-pages | |
| folder: release/wwwroot |