Skip to content

Commit ec36abc

Browse files
committed
first pass at building docs via CI
1 parent eaa5d7f commit ec36abc

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

appveyor.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
version: '{build}'
22
os: Visual Studio 2017
33

4+
# REF: https://github.com/docascode/docfx-seed/blob/master/appveyor.yml
5+
before_build:
6+
- ps: |
7+
if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
8+
{
9+
git checkout $env:APPVEYOR_REPO_BRANCH -q
10+
choco install docfx -y
11+
}
12+
13+
after_build:
14+
- ps: |
15+
CD ./docs
16+
if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
17+
{
18+
& docfx docfx.json
19+
if ($lastexitcode -ne 0){
20+
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
21+
}
22+
23+
git config --global credential.helper store
24+
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:ACCESS_TOKEN):x-oauth-basic@github.com`n"
25+
git config --global user.email "jaredcnance@gmail.com"
26+
git config --global user.name "Jared Nance"
27+
git clone https://github.com/json-api-dotnet/JsonApiDotNetCore.git -b gh-pages origin_site -q
28+
Copy-Item origin_site/.git _site -recurse
29+
CD _site
30+
git add -A 2>&1
31+
git commit -m "CI Updates" -q
32+
git push origin gh-pages -q
33+
}
34+
435
environment:
536
POSTGRES_PORT: tcp://localhost:5432
637
POSTGRES_ENV_POSTGRES_USER: postgres
@@ -9,6 +40,8 @@ environment:
940
PGUSER: postgres
1041
PGPASSWORD: Password12!
1142
Data:DefaultConnection: "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=Password12!"
43+
ACCESS_TOKEN:
44+
secure: g1T332Uarmdgtkftchpafa8tDP/7eM4O0BD6iu1wu+zR224IyH5R8pb4sTChr4Ia
1245

1346
pull_requests:
1447
do_not_increment_build_number: true
@@ -40,6 +73,19 @@ artifacts:
4073
- path: .\**\artifacts\**\*.nupkg
4174
name: NuGet
4275

76+
on_success:
77+
- git config --global credential.helper store
78+
- ps: Add-Content "$HOME\.git-credentials" "https://$($env:ACCESS_TOKEN):x-oauth-basic@github.com`n"
79+
- git config --global user.email "jaredcnance@gmail.com"
80+
- git config --global user.name "Jared Nance"
81+
- cd _site
82+
- git init
83+
- git remote add origin https://github.com/jaredcnance/test.git
84+
- git add -A
85+
- git commit -m "deploy"
86+
- git checkout -b gh-pages
87+
- git push -u origin gh-pages
88+
4389
deploy:
4490
- provider: NuGet
4591
server: https://www.myget.org/F/research-institute/api/v2/package

0 commit comments

Comments
 (0)