1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-04 06:46:07 +02:00

docs: improve build

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos A Becker 2022-12-29 20:56:42 -03:00
parent 023da3d4fa
commit 51aaa7d701
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
6 changed files with 26 additions and 1 deletions

View File

@ -10,6 +10,7 @@ on:
- 'cmd/*'
- 'internal/cmd/*'
- 'files/*'
workflow_dispatch:
jobs:
docs:
@ -24,6 +25,9 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: task docs:generate
- run: task docs:releases
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "docs: update cmd docs"

View File

@ -11,6 +11,15 @@ permissions:
packages: write
jobs:
trigger-generate:
runs-on: ubuntu-latest
needs: goreleaser
steps:
- uses: benc-uk/workflow-dispatch@v1
with:
ref: main
token: ${{ secrets.GH_PAT }}
workflow: generate.yml
goreleaser:
runs-on: ubuntu-latest
env:

View File

@ -96,6 +96,13 @@ tasks:
- www/docs/cmd/*.md
- www/docs/contributing.md
docs:releases:
desc: Generate the latest file
cmds:
- ./scripts/pages/releases.sh
generates:
- www/docs/static/latest
docs:imgs:
desc: Download and resize images
cmds:

View File

@ -2,6 +2,6 @@
set -euo pipefail
pip install -U pip
pip install -U mkdocs-material mkdocs-minify-plugin lunr
version="$(curl -sSf -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/goreleaser/nfpm/releases/latest" | jq -r '.tag_name')"
version="$(cat ./www/docs/static/latest)"
sed -s'' -i "s/__VERSION__/$version/g" www/docs/install.md
mkdocs build -f www/mkdocs.yml

4
scripts/pages/releases.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail
curl -sSf -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/goreleaser/nfpm/releases/latest" |
jq -r '.tag_name' >./www/docs/static/latest

1
www/docs/static/latest vendored Normal file
View File

@ -0,0 +1 @@
v2.22.2