fix: fix publish-docs workflow #1272
This file contains hidden or 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: Publish mkdocs | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
name: Build and publish docs | |
runs-on: ubuntu-latest | |
container: | |
image: spotify/techdocs:v1.2.6 | |
steps: | |
- run: apk --no-cache add git | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 | |
with: | |
fetch-depth: 1 | |
- run: ls -al | |
- run: git init | |
- name: Dry run generated mkdocs | |
if: github.event_name == 'pull_request' | |
run: mkdocs build --config-file mkdocs.yml && ls -al | |
- name: Archive test build | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: site | |
path: | | |
site | |
retention-days: 1 | |
- name: Publish generated mkdocs | |
if: github.event_name != 'pull_request' | |
run: mkdocs gh-deploy --config-file mkdocs.yml -r 'github-actions[bot]' |