Skip to content

Commit

Permalink
Let GH-Action deploy instead of statiq pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
suchja committed May 22, 2024
1 parent 7efc5b9 commit 6dcdbf0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ on:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest
defaults:
run:
working-directory: statiq-dopetrope-demo
Expand All @@ -20,10 +21,30 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- run: dotnet run -- deploy -l "Trace"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Run
run: dotnet run

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload static site generated in the output folder
path: './output'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 0 additions & 5 deletions statiq-dopetrope-demo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
return await Bootstrapper
.Factory
.CreateWeb(args)
.DeployToGitHubPagesBranch(
"suchja",
"statiq-dopetrope-demo",
Config.FromSetting<string>("GITHUB_TOKEN"),
"gh-pages")
.RunAsync();

0 comments on commit 6dcdbf0

Please sign in to comment.