Manual GDrive save #53
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: publish | |
env: | |
VERSION: '3.0.4' | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
name: build, publish, and deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET 8 | |
uses: actions/setup-dotnet@v4 | |
with: | |
# Semantic version range syntax or exact version of a dotnet version | |
dotnet-version: '8.x' | |
- name: Install dependencies | |
run: dotnet restore | |
working-directory: ./src | |
- name: Build | |
run: dotnet build --configuration Release -p:Version=${{ env.VERSION }} --no-restore --nologo | |
working-directory: ./src | |
#- name: Test | |
# run: dotnet test --no-restore --verbosity normal | |
# working-directory: ./src | |
- name: Publish | |
run: dotnet publish --configuration Release --property:PublishDir=publish -p:Version=${{ env.VERSION }} --no-build --nologo | |
working-directory: ./src | |
# copy index.html to 404.html to fix GitHub Pages SPA navigation | |
- name: copy index.html to 404.html | |
run: | | |
cp index.html 404.html | |
working-directory: ./src/publish/wwwroot | |
# add .nojekyll file so GitHub pages will not treat this as a Jekyll project | |
- name: Add .nojekyll file | |
run: touch publish/wwwroot/.nojekyll | |
working-directory: ./src | |
- name: Deploy | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: src/publish/wwwroot | |
- name: Git tag | |
run: git tag v${{ env.VERSION }} | |
- name: Push tag | |
run: git push origin v${{ env.VERSION }} |