update-assets #221
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-assets | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [rebuild-pages] | |
jobs: | |
rebuild: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.4" | |
with: | |
ref: master | |
- name: "Bump version based on manifest" | |
working-directory: assets | |
shell: pwsh | |
run: | | |
# curl -O https://raw.githubusercontent.com/dataplat/dbatools/master/dbatools.psd1 | |
# $modData = Invoke-Expression -Command (Get-Content dbatools.psd1 -Raw) | |
# $moduleversion = $modData.ModuleVersion | |
# Get it right from the PS Source instead while 2.0 is still in preview | |
$moduleversion = (Find-Module dbatools).Version | |
$ext = Get-Content .\external.json | ConvertFrom-Json | |
echo "Module version: $moduleversion" | |
echo "External version: $($ext.Version)" | |
if ($ext.Version -ne $moduleversion) { | |
$ext.Version = $moduleversion | |
$ext | ConvertTo-Json | Out-File ./external.json | |
} | |
# Remove-Item ./dbatools.psd1 -Force | |
- name: "Build docs" | |
working-directory: assets | |
shell: pwsh | |
run: | | |
curl -O https://raw.githubusercontent.com/dataplat/dbatools/master/bin/dbatools-index.json | |
$OutputFolder = (Get-Location).Path | |
Write-Host "running in $OutputFolder" | |
Get-ChildItem $OutputFolder | |
./templates/to_md.ps1 | |
- name: commit if file changed | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: refreshing docs pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |