-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add site preview via Netlify #214
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4ef80f5
--wip-- [skip ci]
tdstein ac33b00
--wip-- [skip ci]
tdstein 8344172
--wip--
tdstein 68bda05
--wip--
tdstein 4b8a6bf
docs: set theme to posit-docs
tdstein 83cd0c6
docs: fix deps using direct references
tdstein c3cf873
docs: adds footer
tdstein fdaf8ab
ci: add docs site preview
tdstein 5e1a9b9
fix: silent version output
tdstein 664cea2
fix: use netlify-cli
tdstein e0dc4ef
ci: comment site preview
tdstein b65be49
show output in step summary
tdstein 8094885
remove file
tdstein ac541c7
remove whitespace
tdstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Site | ||
on: | ||
- pull_request | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
check-latest: true | ||
cache: 'pip' | ||
- uses: quarto-dev/quarto-actions/setup@v2 | ||
- run: make deps | ||
- run: make dev | ||
- run: make docs | ||
- uses: actions/setup-node@v4 | ||
- id: netlify | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
run: | | ||
preview_url=$(make --silent -C ./docs netlify | tail -n 1 | tr -d '"') | ||
echo "# 🚀 Site Preview" >> $GITHUB_STEP_SUMMARY | ||
echo "$preview_url" >> $GITHUB_STEP_SUMMARY |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,48 @@ | ||
.DEFAULT_GOAL := all | ||
|
||
# Command aliases | ||
QUARTO=quarto | ||
QUARTODOC=quartodoc | ||
PIP ?= pip3 | ||
QUARTO ?= quarto | ||
QUARTODOC ?= quartodoc | ||
|
||
# Environment variables | ||
CURRENT_YEAR := $(shell date +%Y) | ||
VERSION := $(shell make -C ../ version) | ||
export CURRENT_YEAR VERSION | ||
NETLIFY_SITE_ID ?= 5cea1f56-7935-4387-975a-18a7905d15ee | ||
CURRENT_YEAR ?= $(shell date +%Y) | ||
VERSION ?= $(shell make --silent -C ../ version | tail -n 1) | ||
|
||
.PHONY: clean build deps preview | ||
.PHONY: all \ | ||
api \ | ||
build \ | ||
clean \ | ||
deps \ | ||
preview | ||
|
||
all: deps api build | ||
|
||
api: deps | ||
api: | ||
$(QUARTODOC) build | ||
$(QUARTODOC) interlinks | ||
cp -r _extensions/ reference/_extensions # Required to render footer | ||
|
||
build: api | ||
build: | ||
CURRENT_YEAR=$(CURRENT_YEAR) \ | ||
VERSION=$(VERSION) \ | ||
$(QUARTO) render | ||
|
||
clean: | ||
rm -rf _extensions _inv _site .quarto reference objects.json | ||
find . -type d -empty -delete | ||
|
||
deps: | ||
$(PIP) install --upgrade pip -r requirements-site.txt | ||
$(QUARTO) add --no-prompt posit-dev/[email protected] | ||
$(QUARTO) add --no-prompt machow/quartodoc | ||
|
||
preview: api | ||
preview: | ||
CURRENT_YEAR=$(CURRENT_YEAR) \ | ||
VERSION=$(VERSION) \ | ||
$(QUARTO) preview | ||
|
||
|
||
netlify: | ||
NETLIFY_SITE_ID=$(NETLIFY_SITE_ID) npx -y netlify-cli deploy --dir _site --json | jq '.deploy_url' |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
quartodoc |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ pandas | |
pre-commit | ||
pyjson5 | ||
pytest | ||
quartodoc | ||
rsconnect | ||
responses | ||
ruff | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just prints in the CI logs right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renders in the preview summary: https://github.com/posit-dev/posit-sdk-py/actions/runs/9452439576?pr=214
(bottom of page) \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, that's not bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started playing with writing a comment to the PR, but updating existing comments on re-runs ended up taking more effort than it was worth.