Skip to content

Commit

Permalink
chore: released docs versioning
Browse files Browse the repository at this point in the history
* ci: added logic for creating new versions through a bash script

* ci: added script to update docusarus config file programmatically

* chore: update script

* ci: updated versions script

* ci: updated versions script

* chore: script update

* chore: save

* chore:save

* save

* save

* save

* save

* save

* save

* sve

* save

* save

* save

* save

* chore: updates to script

* save

* docs: save

* save

* save

* save

* save

* chore: script updates

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* ci: added versioning logic

* ci: update temp folder for Netlify

* ci: netlify debug

* ci: updated versions script

* ci: added output

* ci: start build

* ci: more netlify debug

* ci: debug-netlify-2

* ci: netlify-3

* chore: netlify-4

* ci: netlify-5

* ci: netlify-6

* ci: netlify-6

* ci: netlify-7

* ci: netlify-7

* ci: netlify-8

* ci: netlify-9

* ci: netlify-11

* ci: netlify-12

* ci: netlify-12

* ci: netlify-13

* ci: netlify-14

* ci: netlify-15

* ci: netlify-16

* ci: netlify-17

* ci: netlify-18

* ci: netlify-19

* ci: netlify-20

* ci: netlify-21

* ci: preview versioning

* ci: preview versioning

* ci: preview versioning-3

* ci: preview versioning-3

* ci: preview versioning-3

* ci: preview versioning-3

* ci: preview versioning-3

* ci: preview versioning-5

* save

* save

* save

* save

* save

* ci: preview versioning-6

* ci: new logic

* ci: netlify error fix

* ci: netlify working-2

* ci: netlify test

* save

* ci: netlify

* ci: netlify part1

* ci: netlify part2

* ci: netlify part 3

* save

* save

* ci: netlify part 3

* chore: minor update

* Document serviceDomain parameter in k8s config: PCP-935 (#1527)

* Added serviceDomain to first tab only

* Add serviceDomain to all version tabs

* Removed breaks as needed, indented yaml

* Fixed typo

* Removed unneeded 'the' before link.

* chore: removed version-3-4

* chore: debug

* save

* save

* docs: updated readme

* chore: eks-d redirect

* chore: versioning working

* docs: updated readme

* ci: test netlify local builds

* ci: netlify tests

* ci: update netlify build

* ci: netlify test 5

* ci: netlify 6

* ci: updated netlify

* ci: save

* ci: more netlify changes

* ci: more netlify changes

* ci: more netlify changes

* ci: more netlify changes

* ci: more netlify changes

* ci: more netlify changes

* ci: more netlify changes

* ci: PR comment updates

* ci: PR comment updates

* ci: PR comment updates

* ci: updated ci workflow

* ci: test self-hosted runner

* ci: install netlify

* ci: netlify ci

* ci: netlify

* docs: updated readme

* ci: testing large runners

* ci: testing large runners

* ci: testing large runners

* ci: ci runner update

* docs: save ci

* chore: save

* ci: removed CI build step for test

* ci: save

* ci: save
  • Loading branch information
karl-cardenas-coding committed Sep 17, 2023
1 parent 22771c2 commit e2ef3ff
Show file tree
Hide file tree
Showing 23 changed files with 58,114 additions and 27,608 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"repoName": "librarium",
"editor": "code",

"targetBranchChoices": ["master", "version-4-0", "version-3-4", "version-3-3"],
"targetBranchChoices": ["master", "version-4-0", "version-3-4"],

"autoMerge": true,
"autoMergeMethod": "squash",
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/aloglia_crawler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: Algolia Crawler

on:
workflow_run:
workflows: [Release to Production]
workflows: ["Release to Production"]
types: [completed]
jobs:
docsearch:
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run scraper
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand All @@ -25,4 +28,4 @@ jobs:
SLACK_USERNAME: "spectromate"
SLACK_ICON_EMOJI: ":robot_panic:"
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'The Docs Algolia crawler cron job failed. Please check the GitHub Actions logs for more details.'
SLACK_MESSAGE: 'The Docs Algolia crawler job failed. Please check the GitHub Actions logs for more details.'
4 changes: 3 additions & 1 deletion .github/workflows/eslint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
build:
name: Build
needs: [run-ci]
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Repository
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/image_optimizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
image-optimizer:
name: Image Optimization
needs: [run-ci]
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Repository
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ jobs:
build:
name: Build
needs: [run-ci]
runs-on: ubuntu-latest
# runs-on: [self-hosted, linux, x64]
runs-on:
group: Default
labels: docbot
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Repository
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ concurrency:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot

steps:
- name: Check out repository
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Release to Production

# Run this workflow every time a new commit is pushed to the master branch
# or when a workflow run from the Version Branch Update workflow completes.
# In either case, the branch used for the build will be master.

on:
push:
branches: [master]
workflow_run:
workflows: [Version Branch Update]
types: [completed]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -19,13 +26,19 @@ env:
jobs:
build:
name: Build Website
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "master"


- name: Setup Node.js environment
uses: actions/setup-node@v3
uses: actions/setup-node@v
with:
node-version: "18"
cache: "npm"
Expand All @@ -34,6 +47,7 @@ jobs:

- name: Compile
run: |
make versions-ci
make build
- name: Upload to AWS
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/url-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ concurrency:
name: Broken URL check
jobs:
markdown-link-check:
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
steps:
- id: checkout
name: Checkout Repository
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/version-branch-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ env:
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}


jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot


steps:
- name: Check out repository
Expand All @@ -41,10 +46,37 @@ jobs:
node-version: '18'
cache: 'npm'


- run: npm ci

- 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
update-only: true

- name: Build
- name: Netlify Build
run: |
make build
netlify build --context deploy-preview
- name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@v2.1.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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ palette-docs.pdf

docs/api-content/api-docs/v1/*.mdx
docs/api-content/api-docs/v1/sidebar.js

# Versions Content
versions.json
versioned_docs/
versioned_sidebars/
versioned_sidebars/*
temp.docusaurus.config.js
staging_docs/
staging_sidebars/
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

./scripts/check-branch.sh
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ IMAGE:=spectrocloud/librarium
# Retrieve all modified files in the content folder and compare the difference between the master branch git tree blob AND this commit's git tree blob
CHANGED_FILE=$(shell git diff-tree -r --no-commit-id --name-only master HEAD | grep content)

TEMP_DIR=$(shell $TMPDIR)

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[0m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


initialize: ## Initialize the repository dependencies
@echo "initializing npm dependencies"
npm ci
npx husky-init

clean: ## Clean build artifacts
rm -rf node_modules build public .cache .docusaurus
docker image rm $(IMAGE) || echo "No image exists."
Expand All @@ -27,6 +35,15 @@ build: ## Run npm build
rm -rf build
npm run build

versions: ## Create Docusarus content versions
@echo "creating versions"
./scripts/versions.sh $(TMPDIR)


versions-ci: ## Create Docusarus content versions in a GitHub Actions CI environment
@echo "creating versions"
./scripts/versions.sh $$RUNNER_TEMP

##@ Git Targets

commit: ## Add a Git commit. Usage: make commit MESSAGE="<your message here>"
Expand All @@ -44,15 +61,22 @@ docker-start: docker-image ## Start a local development container
docker run --rm -it -v $(CURDIR)/docs:/librarium/docs/ -p 9000:9000 $(IMAGE)


##@ Writing Checks

sync-vale: ## Install Vale plugins
vale sync

check-writing: ## Run Vale lint checks
vale $(CHANGED_FILE)


##@ Clean Server Artifacts

fix-server: ## Fix server issues by removing the cache folder and reinstalling node modules
@echo "fixing server"
rm -rfv node_modules && rm -rfv .cache/ && npm ci
rm -rfv node_modules && npm ci && npm run clear

###@ PDF Generation

pdf: ## Generate PDF from docs
@echo "generating pdf"
Expand Down
Loading

0 comments on commit e2ef3ff

Please sign in to comment.