Skip to content

Commit

Permalink
Merge branch 'master' into doc-1191
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliiiah committed May 23, 2024
2 parents 4bda36a + 4a330f3 commit 04858e1
Show file tree
Hide file tree
Showing 25 changed files with 577 additions and 66 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/clean-up-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ on:
branches-ignore: [master, main, gh-pages]


env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
GITHUB_BRANCH: ${{ github.event.ref }}

concurrency:
group: ${{ github.event.ref }}
cancel-in-progress: true

jobs:
update_netlify:
runs-on: ubuntu-latest
steps:

- name: Checkout GitHub Pages Branch
uses: actions/checkout@v4

- name: Remove Branch From Netlify
run: cd scripts && ./netlify_remove_branch.sh

delete_reports:
name: Delete Reports
runs-on: ubuntu-latest
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/release-branch-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
ALGOLIA_ADMIN_KEY: ${{ secrets.DEV_ALGOLIA_ADMIN_KEY }}
ALGOLIA_APP_ID: ${{ secrets.DEV_GATSBY_ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.DEV_GATSBY_ALGOLIA_SEARCH_KEY }}
GITHUB_BRANCH: ${{ github.ref_name }}


concurrency:
Expand All @@ -36,34 +37,25 @@ jobs:
node-version: "20"
cache: "npm"

- name: Determine branch name
id: extract_branch
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "GITHUB_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
else
echo "GITHUB_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- run: npm ci

- name: Update Netlify for Collab Drawer
run: cd scripts && ./netlify_add_branch.sh

- name: Post Netlify progress
uses: mshick/add-pr-comment@v2
with:
message: |
🤖 Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes.
refresh-message-position: true
🤖 Netlify configured to enable preview build for branch: ${{env.GITHUB_BRANCH}} . Subsequent commits will automatically trigger a Netlify build preview.
refresh-message-position: false

- run: npm run build

- name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@v3.0.0
with:
publish-dir: ./build
deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}'
enable-pull-request-comment: true
overwrites-pull-request-comment: true
enable-commit-comment: true

- name: Post Netlify URL
uses: mshick/add-pr-comment@v2
with:
message: |
🚀 Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes.
message-failure: |
👎 Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information.
refresh-message-position: true
update-only: true

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ screenshots/
tests/screenshot.spec.ts-snapshots/
test-results/
playwright-report/
artifact.zip
artifact.zip

# Ignore _partials/index.ts
_partials/index.ts
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ init: ## Initialize npm dependencies
npx husky install

start: ## Start a local development server
make generate-partials
npm run start

build: ## Run npm build
Expand Down Expand Up @@ -203,6 +204,11 @@ format-images: ## Format images
@echo "formatting images in /static/assets/docs/images/ folder"
./scripts/compress-convert-images.sh

###@ Generate _partials/index.ts required to automatic partials usage.

generate-partials: ## Generate
./scripts/generate-partials.sh

###@ Aloglia Indexing

update-dev-index: ## Update the Algolia index for the dev environment
Expand Down
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To contribute, we recommend having the following software installed locally on y

- git configured and access to github repository

- Node.js v18 and npm.
- Node.js v20 and npm.

- [Vale](https://vale.sh/docs/vale-cli/installation/)

Expand Down Expand Up @@ -554,6 +554,64 @@ scheme. The rows of cards are dynamically created according to the list of speci
/>
```
## Partials Component
This is a custom component that allows you to create and use
[Import Markdown](https://docusaurus.io/docs/3.2.1/markdown-features/react#importing-markdown).
Partials must be created under the `_partials` folder. They must be named using an `_` prefix and the `*.mdx` filetype.
Partials may be organised in any further subfolders as required. For example, you could create
`_partials/public-cloud/_palette_setup.mdx`.
In order to aid with organisation and categorization, partials must have a `partial_category` and `partial_name` defined
in their frontmatter:
```mdx
---
partial_category: public-cloud
partial_name: palette-setup
---
This is how you set up Palette in {props.cloud}.
```
Partials are customized using properties which can be read using the `{props.field}` syntax.
Once your partial has been created, run the `make generate-partials` command to make your partial available for use.
This command will also be invoked during the `make start` and `make build` commands.
Finally, you can reference your partial in any `*.md` file by using the `PartialsComponent`, together with the specified
category and name of the partial:
```md
<PartialsComponent
category="public-cloud"
name="palette-setup"
cloud="AWS"
/>
```
Note that the `cloud` field corresponds to the `{props.cloud}` reference in the `*.mdx` file.
### Internal Links
Due to the complexities of Docusaurus plugin rendering, links do not support versioning in `*.mdx` files. If you want to
add an internal link you will have to use the `VersionedLink` component inside the `*.mdx` file.
```mdx
---
partial_category: public-cloud
partial_name: palette-setup
---
This is how you set up Palette in {props.cloud}.
This is an <VersionedLink name="Internal Link" url="/getting-started/additional-capabilities"/>.
```
The path of the link should be the path of the destination file from the root directory, without any back operators
`..`. External links can be referenced as usual.
## Netlify Previews
By default Netlify previews are enabled for pull requests. However, some branches do not require Netlify previews. In
Expand Down
8 changes: 8 additions & 0 deletions _partials/_partial_example.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
partial_category: example-cat
partial_name: example-name
---

This is an example partial with an example property. {props.message}

Read more about how to use partials in our [README](https://github.com/spectrocloud/librarium/blob/master/README.md).
2 changes: 1 addition & 1 deletion docs/docs-content/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The first step towards adopting Palette in your organization is to
We have curated the pages in the Getting Started section to give you a gradual introduction to the fundamental concepts
and workflows you need to deploy and manage Kubernetes clusters through Palette.

<div class="desktop-only-display">
<div className="desktop-only-display">

![Overview of the getting started journey rocket](/getting-started/getting-started_getting-started_journey-overview.webp)

Expand Down
Loading

0 comments on commit 04858e1

Please sign in to comment.