Skip to content

Commit

Permalink
ci: don't deploy documentation if there are no changes to it (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
dadrus authored Oct 8, 2022
1 parent a543230 commit 4b7ef0e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ jobs:
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Calculate diff of the docs
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
docs/**
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
Expand Down Expand Up @@ -270,7 +275,7 @@ jobs:
regex: false
include: docs/**
- name: Update version string to dev version
if: github.ref == 'refs/heads/main' && needs.prepare-release.outputs.release_created == false
if: github.ref == 'refs/heads/main' && needs.prepare-release.outputs.release_created == false && env.GIT_DIFF
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "x-current-version"
Expand All @@ -294,7 +299,7 @@ jobs:
run: |
cat ./docs/versions/data.json | jq '. + [{ "version": "${{ needs.prepare-release.outputs.tag_name }}", "path": "/heimdall/${{ needs.prepare-release.outputs.tag_name }}" }]' | tee ./docs/versions/data.json
- name: Deploy dev documentation
if: github.ref == 'refs/heads/main' && needs.prepare-release.outputs.release_created == false
if: github.ref == 'refs/heads/main' && needs.prepare-release.outputs.release_created == false && env.GIT_DIFF
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 4b7ef0e

Please sign in to comment.