Skip to content

Commit cda07d4

Browse files
committed
Include documentation builder
1 parent 20dccb7 commit cda07d4

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/ci.yml

+38-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,45 @@ on: [push, pull_request]
55
env:
66
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
8+
DOCS_PATH: ${{ secrets.DOCS_PATH }}
9+
DOCS_BRANCH: ${{ secrets.DOCS_BRANCH }}
810

911
jobs:
12+
can_document:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
value: ${{ steps.check_job.outputs.value }}
16+
steps:
17+
- name: Checks whether documentation can be built
18+
id: check_job
19+
run: |
20+
echo "value: ${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
21+
echo "::set-output name=value::${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
22+
23+
documentation:
24+
needs: [can_document]
25+
runs-on: ubuntu-latest
26+
if: needs.can_document.outputs.value == 'true'
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: Use Node.js
32+
uses: actions/setup-node@v1
33+
with:
34+
node-version: "14.x"
35+
registry-url: 'https://registry.npmjs.org'
36+
37+
- name: Install Dependencies
38+
run: |
39+
cd $DOCS_PATH
40+
npm install
41+
42+
- name: Deploy Doclet
43+
run: |
44+
cd $DOCS_PATH
45+
npx pilet publish --fresh --url https://feed.piral.cloud/api/v1/pilet/anglesharp --api-key ${{ secrets.PIRAL_FEED_KEY }}
46+
1047
linux:
1148
runs-on: ubuntu-latest
1249

@@ -24,7 +61,7 @@ jobs:
2461

2562
- name: Build
2663
run: |
27-
if ($env:GITHUB_REF -eq "refs/heads/master") {
64+
if ($env:GITHUB_REF -eq "refs/heads/main") {
2865
.\build.ps1 -Target Publish
2966
} elseif ($env:GITHUB_REF -eq "refs/heads/devel") {
3067
.\build.ps1 -Target PrePublish

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ artifacts/
7575
[Tt]ools/
7676
![Tt]ools/packages.config
7777
TestResults/
78+
node_modules
79+
package-lock.json
7880
*.nuget.targets
7981
*.nuget.props
8082
*.nupkg

0 commit comments

Comments
 (0)