Skip to content

Commit

Permalink
Add a website 3.0 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey committed Jan 23, 2025
1 parent 7e5ed1f commit 7cbde53
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Website Build
on:
push:
branches:
- 'feature/website-3.0'
pull_request:
permissions:
contents: read
pages: write
id-token: write

jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Website
run: |
git submodule update --init --recommend-shallow eng/submodules/silk.net-2.x
./build.sh website
- name: Upload artifact
if: ${{ github.repository == 'dotnet/Silk.NET' && github.ref == 'refs/heads/develop/3.0' }}
uses: actions/upload-pages-artifact@v1
with:
path: "artifacts/docs/Silk.NET"
Deploy:
if: ${{ github.repository == 'dotnet/Silk.NET' && github.ref == 'refs/heads/develop/3.0' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: Build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
12 changes: 4 additions & 8 deletions eng/build/Build.Website.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ readonly record struct VersionDescription(
AbsolutePath? Changelog = null
);

// From oldest to newest. Last one is current.
const bool IsCurrentVersionPreview = true;

[Parameter("If enabled, skips scraping the contributors for the authors.yml file of the blog.")]
readonly bool SkipContributorsScrape;

Expand Down Expand Up @@ -107,13 +104,12 @@ await GetAuthorsContents().ToListAsync()
}

jsonVersions[i == versions.Length - 1 ? "current" : version.Name] = new JsonVersion(
version.Changelog is { } changelog
? GetVersionFromChangelog(changelog)
version.Changelog is { } changelog ? GetVersionFromChangelog(changelog)
: File.Exists(version.Path / "version.txt")
? File.ReadAllText(version.Path / "version.txt")
: Git($"describe --tags --abbrev=0", version.Path)
.First(x => x.Type == OutputType.Std)
.Text.Trim(),
: Git($"describe --tags --abbrev=0", version.Path)
.First(x => x.Type == OutputType.Std)
.Text.Trim(),
i == versions.Length - 1 ? version.Name : null
);
}
Expand Down
2 changes: 1 addition & 1 deletion eng/submodules/silk.net-2.x
Submodule silk.net-2.x updated 32 files
+13 −27 .github/workflows/publish-site.yml
+3 −0 .gitignore
+19 −0 .nuke/build.schema.json
+2 −0 Directory.Build.props
+2 −0 Directory.Build.targets
+0 −33 Silk.NET.sln
+69 −0 build/nuke/Build.Website.cs
+4 −1 build/nuke/Silk.NET.NUKE.csproj.DotSettings
+23 −0 documentation/silk.net/deprecation-notices/README.md
+0 −0 documentation/silk.net/deprecation-notices/SilkManager.md
+0 −0 documentation/silk.net/deprecation-notices/VulkanViews.md
+0 −13 src/Website/Silk.NET.Statiq.TableOfContents/Internals/BakedToc.cs
+0 −42 src/Website/Silk.NET.Statiq.TableOfContents/Internals/GlobArrayOrTocsJsonConverter.cs
+0 −13 src/Website/Silk.NET.Statiq.TableOfContents/Internals/LoadedRawToc.cs
+0 −15 src/Website/Silk.NET.Statiq.TableOfContents/Internals/Utilities.cs
+0 −9 src/Website/Silk.NET.Statiq.TableOfContents/PathMatcher.cs
+0 −31 src/Website/Silk.NET.Statiq.TableOfContents/ProcessModules/AddTableOfContents.cs
+0 −164 src/Website/Silk.NET.Statiq.TableOfContents/ProcessModules/BakeTocIntoDocuments.cs
+0 −193 src/Website/Silk.NET.Statiq.TableOfContents/ProcessModules/BakeTocModels.cs
+0 −155 src/Website/Silk.NET.Statiq.TableOfContents/ProcessModules/LoadRawToc.cs
+0 −13 src/Website/Silk.NET.Statiq.TableOfContents/Silk.NET.Statiq.TableOfContents.csproj
+0 −115 src/Website/Silk.NET.Statiq.TableOfContents/TableOfContentsElement.cs
+0 −13 src/Website/Silk.NET.Statiq.TableOfContents/TableOfContentsExtensions.cs
+0 −11 src/Website/Silk.NET.Statiq.TableOfContents/TableOfContentsModel.cs
+0 −17 src/Website/Silk.NET.Statiq/CaptionShortCode.cs
+0 −97 src/Website/Silk.NET.Statiq/FancyImageShortCode.cs
+0 −62 src/Website/Silk.NET.Statiq/ForAllMatching.cs
+0 −25 src/Website/Silk.NET.Statiq/InfoWarningShortCodes.cs
+0 −159 src/Website/Silk.NET.Statiq/Program.cs
+0 −24 src/Website/Silk.NET.Statiq/Silk.NET.Statiq.csproj
+0 −43 src/Website/Silk.NET.Statiq/Utilities.cs
+0 −6 src/Website/Silk.NET.Statiq/global.json

0 comments on commit 7cbde53

Please sign in to comment.