Skip to content

Commit 92c2ac5

Browse files
Merge pull request #3 from michaeltlombardi/maint/main/repo-prep
(MAINT) Prep repo for public release
2 parents 0bca462 + 902bf5e commit 92c2ac5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1574
-31
lines changed

.build.ps1

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env pwsh
2+
#
3+
# Copyright (c) Microsoft Corporation.
4+
# Licensed under the MIT License.
5+
#
6+
#requires -Version 7.2
7+
#requires -Module InvokeBuild
8+
9+
[cmdletbinding()]
10+
param(
11+
[string]$SiteBaseUrl
12+
)
13+
14+
task CheckPrereqs {
15+
if (-not (Get-Command hugo -ErrorAction Ignore)) {
16+
throw "Hugo is not installed. Please install Hugo extended edition from https://gohugo.io/getting-started/installing/"
17+
}
18+
$HugoVersion = hugo version
19+
if (-not ($HugoVersion -match 'hugo v(?<version>\d+\.\d+\.\d+)[^+]+\+extended')) {
20+
throw "Hugo is installed but not the extended edition. Please install Hugo extended edition from https://gohugo.io/getting-started/installing/"
21+
}
22+
if ([version]($Matches.version) -lt [version]'0.115.0') {
23+
throw "Hugo is installed but the version is too old. Please install Hugo extended edition, minimum version 0.115.0, from https://gohugo.io/getting-started/installing/"
24+
}
25+
if (-not (Get-Command go)) {
26+
throw "Go is not installed. Please install Go 1.19 or higher from https://golang.org/dl/"
27+
}
28+
}
29+
30+
task PrepareSite CheckPrereqs, {
31+
# Nothing to do yet, included for future use.
32+
}
33+
34+
task BuildSite PrepareSite, {
35+
Push-Location -Path "$BuildRoot/.site"
36+
if ([string]::IsNullOrEmpty($SiteBaseUrl)) {
37+
$SiteBaseUrl = $env:DEPLOY_PRIME_URL
38+
}
39+
# if ([string]::IsNullOrEmpty($SiteBaseUrl)) {
40+
# $SiteBaseUrl = 'https://quiet-snickerdoodle-38a82c.netlify.app/'
41+
# }
42+
hugo --gc --minify -b $SiteBaseUrl
43+
Pop-Location
44+
}
45+
46+
task ServeSite PrepareSite, {
47+
Push-Location -Path "$BuildRoot/.site"
48+
hugo server
49+
Pop-Location
50+
}

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM mcr.microsoft.com/devcontainers/base:ubuntu
2+
RUN wget https://github.com/errata-ai/vale/releases/download/v2.26.0/vale_2.26.0_Linux_64-bit.tar.gz && \
3+
tar -xvzf vale_2.26.0_Linux_64-bit.tar.gz -C bin && \
4+
export PATH=./bin:"$PATH"

.devcontainer/devcontainer.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "Default Dev Container",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/git:1": {},
8+
"ghcr.io/devcontainers/features/github-cli:1": {},
9+
"ghcr.io/devcontainers/features/powershell:1": {
10+
"modules": "InvokeBuild,PSDesiredStateConfiguration"
11+
},
12+
"ghcr.io/devcontainers/features/go": {},
13+
"ghcr.io/devcontainers/features/hugo:1": {
14+
"extended": true
15+
},
16+
"ghcr.io/devcontainers/features/node:1": {
17+
"version": "latest"
18+
}
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
"chrischinchilla.vale-vscode",
24+
"davidanson.vscode-markdownlint",
25+
"docsmsft.docs-linting",
26+
"docsmsft.docs-markdown",
27+
"eamodio.gitlens",
28+
"marvhen.reflow-markdown",
29+
"ms-vscode.powershell",
30+
"ms-vscode.wordcount",
31+
"nhoizey.gremlins",
32+
"redhat.vscode-yaml",
33+
"shuworks.vscode-table-formatter",
34+
"streetsidesoftware.code-spell-checker",
35+
"tyriar.sort-lines",
36+
"usernamehw.errorlens",
37+
"wmaurer.change-case",
38+
],
39+
"settings": {
40+
"terminal.integrated.defaultProfile.linux": "pwsh",
41+
"vale.valeCLI.path": "",
42+
"vale.valeCLI.config": ""
43+
}
44+
}
45+
},
46+
"forwardPorts": [
47+
1313
48+
],
49+
"postStartCommand": "vale sync",
50+
}

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://help.github.com/articles/about-codeowners/
2+
3+
* @sdwheeler @michaeltlombardi

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# PR Summary
2+
3+
<!--
4+
Delete this comment block and summarize your changes and list
5+
related issues here. For example:
6+
7+
This changes fixes problem X in the documentation for Y.
8+
9+
- Fixes #1234
10+
- Resolves #1235
11+
-->
12+
13+
## PR Checklist
14+
15+
<!--
16+
These items are mandatory. For your PR to be reviewed and merged,
17+
ensure you have followed these steps. As you complete the steps,
18+
check each box by replacing the space between the brackets with an
19+
x or by clicking on the box in the UI after your PR is submitted.
20+
-->
21+
22+
- [ ] **Descriptive Title:** This PR's title is a synopsis of the changes it proposes.
23+
- [ ] **Summary:** This PR's summary describes the scope and intent of the change.
24+
- [ ] **Contributor's Guide:** I have read the [contributors guide][contrib].
25+
- [ ] **Style:** This PR adheres to the [style guide][style].
26+
27+
<!--
28+
If your PR is a work in progress, please mark it as a draft or
29+
prefix it with "(WIP)" or "WIP:"
30+
31+
This helps us understand whether or not your PR is ready to review.
32+
-->
33+
34+
[contrib]: https://powershell.github.io/DSC-Samples/contributing/
35+
[style]: https://powershell.github.io/DSC-Samples/contributing/style-guide/

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'

.github/messages/expectations.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- GHA.Comment.Id.Community.Expectations -->
2+
3+
# Expectations
4+
5+
Thanks for your submission! Here's a quick note to provide you with some context for what to expect
6+
from the docs team and the process now that you've submitted a PR. Even if you've contributed to
7+
this repo before, we strongly suggest reading this information; it might have changed since you last
8+
read it.
9+
10+
This is a brief, high-level summary of what to expect from this process.
11+
12+
The team begins to review your PR if you [request them to][gh-review-request] or if your PR
13+
meets these conditions:
14+
15+
- It's not a [draft PR][gh-drafts].
16+
- It doesn't have a `WIP` prefix in the title.
17+
- It passes validation and build steps.
18+
- It doesn't have any merge conflicts.
19+
- You have checked every box in the [PR Checklist](#pr-checklist), indicating you have completed all
20+
required steps and marked your PR as **Ready to Merge**.
21+
22+
You can **always** request a review at any stage in your authoring process, the team is here to
23+
help! You don't need to submit a fully polished and finished draft; the team can help you get
24+
content ready for merge.
25+
26+
While reviewing your PR, the team may make suggestions, write comments, and ask questions. When all
27+
requirements are satisfied, the team marks your PR as **Approved** and merges it. Once your PR's
28+
merged, it's included when the site rebuilds.
29+
30+
[gh-drafts]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests
31+
[gh-review-request]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review

.github/workflows/checklist.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Checklist
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
types:
7+
- opened
8+
- reopened
9+
- ready_for_review
10+
- edited
11+
- synchronize
12+
permissions:
13+
contents: read
14+
jobs:
15+
Test:
16+
name: Verify Status
17+
runs-on: windows-latest
18+
if: |
19+
!contains(github.event.pull_request.title, 'WIP') &&
20+
!github.event.pull_request.draft
21+
defaults:
22+
run:
23+
shell: pwsh
24+
steps:
25+
- name: Verify Checklist
26+
id: verify_checklist
27+
uses: MicrosoftDocs/PowerShell-Docs/.github/actions/verification/checklist/v1@main

.github/workflows/expectations.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This action comments on a PR by a community member with the expectations they
2+
# should have for the process. It runs every thirty minutes to find uncommented
3+
# community PRs targeting the main branch. It uses a markdown file in the
4+
# .github folder for the content.
5+
name: Commenting
6+
on:
7+
schedule:
8+
- cron: 0/30 * * * *
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
jobs:
13+
Expectations:
14+
name: Share Expectations on Community PRs
15+
if: github.repository_owner == 'PowerShell'
16+
runs-on: windows-latest
17+
defaults:
18+
run:
19+
shell: pwsh
20+
steps:
21+
- name: Checkout Repository
22+
id: checkout_repo
23+
uses: actions/checkout@v3
24+
25+
- name: Comment on Community PRs
26+
uses: MicrosoftDocs/PowerShell-Docs/.github/actions/commenting/expectations/v1@main
27+
with:
28+
message_path: .github/messages/expectations.md
29+
token: ${{ github.token }}

.github/workflows/publish.site.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Publish Site
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Set a branch that will trigger a deployment
7+
pull_request:
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow one concurrent deployment
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- uses: actions/checkout@v3
25+
with:
26+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
27+
- name: Setup Pages
28+
uses: actions/configure-pages@v3
29+
- name: Setup Hugo
30+
uses: peaceiris/actions-hugo@v2
31+
with:
32+
hugo-version: latest
33+
extended: true
34+
- name: Setup Node
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: latest
38+
cache: npm
39+
# The action defaults to search for the dependency file (package-lock.json,
40+
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
41+
# hash as a part of the cache key.
42+
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
43+
cache-dependency-path: '**/package-lock.json'
44+
- name: Install PostCSS
45+
run: |
46+
cd ./Site
47+
npm ci
48+
npm ls
49+
cd ..
50+
- name: Setup PowerShell module cache
51+
id: cacher
52+
uses: actions/cache@v3
53+
with:
54+
path: '~/.local/share/powershell/Modules'
55+
key: ${{ runner.os }}-SqlServer-PSScriptAnalyzer
56+
- name: Install required PowerShell modules
57+
if: steps.cacher.outputs.cache-hit != 'true'
58+
shell: pwsh
59+
run: |
60+
Set-PSRepository PSGallery -InstallationPolicy Trusted
61+
Install-Module InvokeBuild, PowerShell-Yaml -ErrorAction Stop
62+
- name: Build the Site
63+
shell: pwsh
64+
env:
65+
HUGO_ENVIRONMENT: production
66+
HUGO_ENV: production
67+
run: |
68+
Invoke-Build -Task BuildSite -SiteBaseUrl https://powershell.github.io/DSC-Samples/
69+
- name: Upload artifact
70+
uses: actions/upload-pages-artifact@v1
71+
with:
72+
path: ./.site/public
73+
# Deployment job
74+
# deploy:
75+
# if: github.ref == 'refs/heads/main'
76+
# environment:
77+
# name: github-pages
78+
# url: ${{ steps.deployment.outputs.page_url }}
79+
# runs-on: ubuntu-latest
80+
# needs: build
81+
# steps:
82+
# - name: Deploy to GitHub Pages
83+
# id: deployment
84+
# uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)