Skip to content

Commit

Permalink
Merge pull request #110 from ahembree/upgrade-docs
Browse files Browse the repository at this point in the history
Upgrade docs
  • Loading branch information
ahembree authored Dec 11, 2024
2 parents 4a8aa56 + 126ecab commit e60003a
Show file tree
Hide file tree
Showing 78 changed files with 20,043 additions and 741 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
paths:
- 'gen-docs/**'

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: gen-docs/package-lock.json

- name: Install dependencies
run: |
cd gen-docs
npm install --frozen-lockfile
- name: Build website
run: |
cd gen-docs
npm run build
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: gen-docs/build

deploy:
name: Deploy to GitHub Pages
needs: build
concurrency: build-deploy-pages

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-22.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
8 changes: 5 additions & 3 deletions .github/workflows/run-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Deployment Tests
run-name: Test Deployment
name: Ubuntu Deployment Tests
run-name: Test Ubuntu Deployments
on:
push:
paths-ignore:
- 'gen-docs/**'
pull_request:
schedule:
- cron: '23 9 * * 0'
Expand All @@ -11,6 +13,7 @@ permissions:

jobs:
Ubuntu_22:
name: Test Ubuntu 22.04
runs-on: ubuntu-22.04
steps:
- name: Check out repo code
Expand All @@ -24,7 +27,6 @@ jobs:
sudo apt install ansible
- name: Ensure base playbook requirements
# should mirror the steps for advanced config creation
# does not use the `make` command since it requires input and we cannot input in a Runner
run: |
mkdir -p ./inventory/group_vars/all
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/test-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Docusaurus Deployment

on:
pull_request:
branches:
- master
paths:
- 'gen-docs/**'

jobs:
test-deploy:
name: Test Install and Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: gen-docs/package-lock.json

- name: Install dependencies
run: |
cd gen-docs
npm install --frozen-lockfile
- name: Test build website
run: |
cd gen-docs
npm run build
30 changes: 2 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ BASEDIR=$(shell pwd)

CUSTOM_CONF_DIR = inventory/group_vars/all

PREV_CUSTOM_CONF_DIR = vars/custom

# Found and modified from: https://gist.github.com/Pierstoval/b2539c387c467c017bf2b0ace5a2e79b
# To use the "confirm" target inside another target,
# use the " if $(MAKE) -s confirm ; " syntax.
Expand All @@ -30,19 +28,10 @@ _WARN := "\033[33m[%s]\033[0m %s\n" # Yellow text for "printf"
_TITLE := "\033[32m[%s]\033[0m %s\n" # Green text for "printf"
_ERROR := "\033[31m[%s]\033[0m %s\n" # Red text for "printf"

basic:
@if $(MAKE) -s confirm ; then \
mkdir -p $(CUSTOM_CONF_DIR); \
cp $(DEFAULT_CONFS) $(CUSTOM_CONF_DIR); \
mv $(CUSTOM_CONF_DIR)/main.yml $(CUSTOM_CONF_DIR)/main_custom.yml; \
chmod 0600 $(CUSTOM_CONF_DIR)/*.yml; \
fi

advanced:
config:
@if $(MAKE) -s confirm ; then \
mkdir -p $(CUSTOM_CONF_DIR); \
cp $(ADVANCED_CONFS) $(CUSTOM_CONF_DIR); \
mv $(CUSTOM_CONF_DIR)/main.yml $(CUSTOM_CONF_DIR)/main_custom.yml; \
chmod 0600 $(CUSTOM_CONF_DIR)/*.yml; \
fi

Expand All @@ -66,23 +55,8 @@ update:
@sed -i 's\hms_docker_library_path\hmsdocker_library_path\g' $(CUSTOM_CONF_DIR)/hmsd_advanced.yml
@echo Update finished

# Used for the migration from the `vars/custom` directory to the correct `inventory/group_vars/all` directory
migrate-vars:
@if [ -d $(PREV_CUSTOM_CONF_DIR) ] && [ ! -L $(PREV_CUSTOM_CONF_DIR) ]; then\
mkdir -p $(CUSTOM_CONF_DIR);\
cp $(PREV_CUSTOM_CONF_DIR)/* $(CUSTOM_CONF_DIR);\
rm -rf $(PREV_CUSTOM_CONF_DIR);\
ln -s $(BASEDIR)/$(CUSTOM_CONF_DIR) $(BASEDIR)/$(PREV_CUSTOM_CONF_DIR);\
echo Moved files and created symlink from $(PREV_CUSTOM_CONF_DIR) to $(CUSTOM_CONF_DIR);\
elif [ -d $(PREV_CUSTOM_CONF_DIR) ] && [ -L $(PREV_CUSTOM_CONF_DIR) ]; then\
echo "Already migrated";\
else\
echo "Previous variables directory does not exist at location: $(PREV_CUSTOM_CONF_DIR)";\
fi

help:
@echo make basic :: setup a basic config
@echo make advanced :: setup an advanced config
@echo make config :: copy default config files
@echo make check :: check for any changes without doing anything \(diff\)
@echo make apply :: apply any changes identified in the diff
@echo make install-reqs :: installs ansible galaxy role requirements
Expand Down
Loading

0 comments on commit e60003a

Please sign in to comment.