Skip to content

update gh-pages branch #26

update gh-pages branch

update gh-pages branch #26

name: update gh-pages branch
on:
workflow_dispatch:
jobs:
build-site:
runs-on: windows-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Check status
run: git status
- name: Download docfx
run: curl https://github.com/dotnet/docfx/releases/download/v2.77.0/docfx-win-x64-v2.77.0.zip -L -o ../docfx-win-x64-v2.77.0.zip
- name: Expand docfx
run: Expand-Archive ../docfx-win-x64-v2.77.0.zip -DestinationPath ../docfx
- name: Build site with docfx
run: "../docfx/docfx.exe build docfx.json --metadata \"{ '_matomoContainerUrl': 'https://matomo.devexpress.com/js/container_kE7MWPi0.js' }\" --warningsAsErrors"
- name: Archive site
run: Compress-Archive -Path _site/* -DestinationPath ${{ runner.temp }}/site.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: github-pages
path: ${{ runner.temp }}/site.zip
publish-pages:
needs: build-site
runs-on: windows-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: github-pages
path: ../
- name: Clear directory
run: Get-ChildItem . -Recurse | Remove-Item -Force -Recurse
- name: Extract archive
run: Expand-Archive -Path ../site.zip -DestinationPath .
- name: Push changes to gh-pages
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Pages update"
git push