Create a Statiq.Web project
- Create a statiq project based on Statiq.Web (here)
- Add theme like CleanBlog (here) (optional)
- Check into github (I know there are other git repositories, but this is microsoft ... things work better when you swim in the same pond) (tutorial)
Create a Static Web resource in Azure
- Create a static website (template is in the Web Category)
- Select resource group (create one if necessary)
- Pick a unique name
- Pick Hosting plan (free is good)
- Pick a region for functions api (close to home)
- Log into GitHub and authorize Azure Static Web Sites to access repositories
- Choose Organization, Repository, Branch
- Build Presets: Custom
- App Location: /output (this is where statiq puts static content)
- Ignore API and Output locations
- Review + Create
Finish the build
- Back to your repository in github
- Click Actions -> Azure Static Web Apps CI/CD (added by M$ in previous step)
- Click the yml link right below the workflow name looks like "azure-static-web-apps-gentle-glacier-0a429ea0f.yml"
- Edit the jobs definition to add build instructions
jobs:
build_and_deploy_job:
if: github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
add:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore
- run: dotnet run --output output
before:
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
Save and enjoy!!
comments powered by