Skip to content

Commit

Permalink
swap github actions work to mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
miniscruff committed Mar 17, 2024
1 parent f8dd544 commit 3deb2ce
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,27 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.6.0
- uses: actions/setup-python@v5
with:
hugo-version: 'latest'
extended: true
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Build docs
run: |
go run main.go gen
awk 'NR > 1' CHANGELOG.md >> docs/content/guide/changelog/index.md
hugo --minify -s docs -b https://changie.dev/
pip install -r requirements.txt
mkdocs build
- name: Deploy Docs
if: "${{ github.event.inputs.deploy }}"
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public
publish_dir: ./site
cname: changie.dev
23 changes: 14 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINGET_PAT: ${{ secrets.WINGET_PAT }}

- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Publish to NPM
run: |
Expand All @@ -52,21 +63,15 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.6.0
with:
hugo-version: 'latest'
extended: true

- name: Build docs
run: |
go run main.go gen
awk 'NR > 1' CHANGELOG.md >> docs/content/guide/changelog/index.md
hugo --minify -s docs -b https://changie.dev/
pip install -r requirements.txt
mkdocs build
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public
publish_dir: ./site
cname: changie.dev
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ coverage.html

# mkdocs files
.cache/
site/
venv/

# goreleaser builds
Expand Down

0 comments on commit 3deb2ce

Please sign in to comment.