Skip to content

Commit

Permalink
Skip CI for docs scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
  • Loading branch information
ncdc committed Mar 3, 2023
1 parent 8bb1ec2 commit f0e994a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docs-gen-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
- "docs/**"
- "pkg/**"
- ".github/workflows/docs-gen-and-push.yaml"
- "hack/deploy-docs.sh"

permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ REQUIREMENTS_TXT=docs/requirements.txt
.PHONY: serve-docs
serve-docs: venv
. $(VENV)/activate; \
VENV=$(VENV) REMOTE=$(REMOTE) BRANCH=$(BRANCH) hack/serve-docs.sh
VENV=$(VENV) REMOTE=$(REMOTE) BRANCH=$(BRANCH) docs/scripts/serve-docs.sh

.PHONY: deploy-docs
deploy-docs: venv
. $(VENV)/activate; \
REMOTE=$(REMOTE) BRANCH=$(BRANCH) hack/deploy-docs.sh
REMOTE=$(REMOTE) BRANCH=$(BRANCH) docs/scripts/deploy-docs.sh

vendor: ## Vendor the dependencies
go mod tidy
Expand Down
17 changes: 9 additions & 8 deletions hack/deploy-docs.sh → docs/scripts/deploy-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -o nounset
set -o pipefail
set -o xtrace

REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
cd "$REPO_ROOT/docs"

if [[ "${GITHUB_EVENT_NAME:-}" == "pull_request" ]]; then
Expand All @@ -40,7 +40,6 @@ else
fi
fi


MIKE_OPTIONS=()

if [[ -n "${REMOTE:-}" ]]; then
Expand All @@ -51,13 +50,15 @@ if [[ -n "${BRANCH:-}" ]]; then
MIKE_OPTIONS+=(--branch "$BRANCH")
fi

git config user.name kcp-docs-bot
git config user.email no-reply@kcp.io

# Only push to gh-pages if we're in GitHub Actions (CI is set) and we have a non-PR event.
if [[ -n "${CI:-}" && "${GITHUB_EVENT_NAME:-}" == "push" ]]; then
MIKE_OPTIONS+=(--push)
if [[ -n "${CI:-}" ]]; then
if [[ "${GITHUB_EVENT_NAME:-}" == "push" ]]; then
# Only push to gh-pages if we're in GitHub Actions (CI is set) and we have a non-PR event.
MIKE_OPTIONS+=(--push)
fi

# Always set git user info in CI because even if we're not pushing, we need it
git config user.name kcp-docs-bot
git config user.email no-reply@kcp.io
fi

mike deploy "${MIKE_OPTIONS[@]}" "$VERSION"
2 changes: 1 addition & 1 deletion hack/serve-docs.sh → docs/scripts/serve-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
cd "$REPO_ROOT/docs"

MIKE_OPTIONS=()
Expand Down

0 comments on commit f0e994a

Please sign in to comment.