-
Notifications
You must be signed in to change notification settings - Fork 12
49 lines (45 loc) · 1.66 KB
/
update-assets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: update-assets
on:
workflow_dispatch:
repository_dispatch:
types: [rebuild-pages]
jobs:
rebuild:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/[email protected]"
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 }}