Skip to content

[Edwin]: Restructure My Keyboards #12

[Edwin]: Restructure My Keyboards

[Edwin]: Restructure My Keyboards #12

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy to Github pages
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main 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 represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Install dotnet version to the ubuntu machine
- name: Sets Up .Net Core SDK 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true
# publish the dotnet blazor to the release folder
- name: Publishes .NET core Project
run: dotnet publish ./practice/practice.csproj -c Release -o release --nologo
# changes the base-tag in index.html from '/' to 'keyboards' to match GitHub Pages repository subdirectory
- name: change base-tag in the index from '/' to '<nameofrepository>' to match github pages subdirectory
run: sed -i 's/<base href="\/" \/>/<base href="\/keyboards\/" \/>/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.htm
# 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
- name: Commit wwwroot to Github Pages
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: gh-pages
folder: release/wwwroot