Merge pull request #35 from kannansuresh/dev #118
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 to GitHub Pages | |
env: | |
RELEASE_DIR: release | |
PUBLISH_DIR: release/wwwroot | |
CSPROJ_FILE: src/Aneejian.Games.ClickMatch.Client/Aneejian.Games.ClickMatch.Client.csproj | |
INDEX_HTML: src/Aneejian.Games.ClickMatch.Client/wwwroot/index.html | |
BASE_HREF: /ClickMatch/ | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
deploy-to-github-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rewrite base href | |
uses: kannansuresh/[email protected] | |
with: | |
html_path: ${{ env.INDEX_HTML }} | |
base_href: ${{ env.BASE_HREF }} | |
- name: Setup .NET Core SDK | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 8.0 | |
- name: Publish .NET Core Project | |
run: dotnet publish ${{ env.CSPROJ_FILE }} -c Release -o ${{ env.RELEASE_DIR }} | |
- name: Add .nojekyll file | |
run: touch ${{ env.PUBLISH_DIR }}/.nojekyll | |
- name: GitHub Pages | |
if: success() | |
uses: crazy-max/[email protected] | |
with: | |
target_branch: gh-pages | |
build_dir: ${{ env.PUBLISH_DIR }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |