Skip to content

Commit c98f7f7

Browse files
docs: moving docs to pages (#3633)
The documentation in our README have become quite extensive over the years. This PR is moving docs including examples and modules to a documentation site. The top-level readme is shrinked down to some basic / essential information. - New top-level readme: https://github.com/philips-labs/terraform-aws-github-runner/tree/npalm/mkdocs?tab=readme-ov-file - Documentation site: https://philips-labs.github.io/terraform-aws-github-runner For examples and module documentation sources in example and module directories are linked. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 677965d commit c98f7f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+15810
-687
lines changed

.ci/terraform-init-all.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
# This script will run terraform init in all subdirectories of the examples directory
4+
# required to run tflint via pre-commit
5+
6+
# only run the script if a uniique pid file exits if not creat it or --force flag is passed
7+
pid="/tmp/philips-labs-terraform-aws-github-runner.pid"
8+
if [ "$1" == "--force" ]; then
9+
rm -f /tmp/philips-labs-terraform-aws-github-runner.pid
10+
fi
11+
12+
if [ ! -f $pid ]; then
13+
echo $$ > $pid
14+
else
15+
echo "Init all terraform directories will be skipped. To run the script remove the file $pid or run with --force"
16+
exit 0
17+
fi
18+
19+
# Change to the examples directory
20+
example_dirs=$(find examples -mindepth 1 -maxdepth 2 -type d | grep -v "templates")
21+
module_dirs=$(find modules -mindepth 1 -maxdepth 2 -type d | grep -v "templates")
22+
23+
# merge example_dirs and module_dirs in terraform_dirs
24+
terraform_dirs=$(echo $example_dirs $module_dirs "modules/runners/pool" | tr " " "\n" | sort -u | tr "\n" " ")
25+
26+
for dir in $terraform_dirs; do
27+
# Check if the subdirectory exists in Git
28+
if git rev-parse --is-inside-work-tree &>/dev/null && git ls-files --error-unmatch "$dir" &>/dev/null; then
29+
echo "Running terraform init in ${dir} - supressing output"
30+
pushd "$dir" >/dev/null
31+
terraform init -lockfile=readonly -backend=false &>/dev/null || true
32+
popd >/dev/null
33+
fi
34+
done

.github/workflows/update-docs.yml

+24-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,32 @@ jobs:
3232
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # ratchet:peter-evans/[email protected]
3333
with:
3434
token: ${{ secrets.GITHUB_TOKEN }}
35-
commit-message: "Update Terraform docs"
35+
commit-message: "docs: auto update terraform docs"
3636
title: "docs: Update Terraform docs"
3737
branch: update-docs
3838
branch-suffix: random
3939
base: ${{ github.event.pull_request.base.ref }}
4040
delete-branch: true
41+
42+
deploy-pages:
43+
needs: [docs]
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
47+
- name: Configure Git Credentials
48+
run: |
49+
git config user.name github-actions[bot]
50+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
51+
- uses: actions/setup-python@v4
52+
with:
53+
python-version: 3.x
54+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
55+
- uses: actions/cache@v3
56+
with:
57+
key: mkdocs-material-${{ env.cache_id }}
58+
path: .cache
59+
restore-keys: |
60+
mkdocs-material-
61+
- run: pip install mkdocs-material
62+
- run: pip install mkdocs-material-extensions
63+
- run: mkdocs gh-deploy --force -c -b gh-pages

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ secrets.auto.tfvars
2222
**/coverage/*
2323

2424
node_modules/
25+
site/

README.md

+50-449
Large diffs are not rendered by default.

docs/ami-examples/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "images/README.md"

docs/assets/aws-architecture.dark.png

563 KB
Loading
535 KB
Loading

0 commit comments

Comments
 (0)