Skip to content
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

Public Reference Architecture Release #646

Merged
merged 27 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3787190
DEV-2297: Staging Website Workflows (#611)
milldr Jun 9, 2024
8b22c82
DEV-2298: Staging Site Redesign (#612)
milldr Jun 20, 2024
68c5368
DEV-2298: Improved Learning Journey (#615)
milldr Jul 2, 2024
1194976
DEV-2305: First Pass Refactoring "Learn" (#617)
milldr Jul 11, 2024
9e7e9d3
Upgrade to Docusarus 3.4.0, Update Nav Bar (#616)
osterman Jul 15, 2024
b91cfba
Import Styles from Atmos (#622)
osterman Jul 16, 2024
9bfca5e
Reorganize Community (#623)
osterman Jul 16, 2024
c7c9a89
Update titles and sidebar titles, convert all pages to MDX (#624)
osterman Jul 17, 2024
e3ba903
DEV-2306: Render Components READMEs (#626)
milldr Jul 25, 2024
6d581e3
Add intros & descriptions (#625)
osterman Jul 26, 2024
322d3d9
Import Content (#627)
osterman Aug 1, 2024
cc21283
Fix Broken Links (#629)
osterman Aug 2, 2024
50fee74
DEV-2308: Render Terraform Modules and GitHub Actions (#628)
milldr Aug 2, 2024
8509d37
DEV-2295: Prerelease Improvements (#630)
milldr Aug 5, 2024
94c8e1e
Refine Metadata and Structure (#632)
osterman Aug 5, 2024
5203fcd
(github actions) generated latest snippets (#631)
cloudpossebot Aug 5, 2024
b3a97b6
Add test change for github actions validation
milldr Aug 6, 2024
bd89c5a
(github actions) generated latest snippets
milldr Aug 6, 2024
3434b02
♻️ fix(DEV-2450): Merge Correction (#637)
cloudpossebot Aug 6, 2024
ffe25e6
(github actions) generated latest snippets
goruha Aug 6, 2024
057b4d6
♻️ Replace `8BitJonny/gh-get-current-pr` with `cloudposse-github-acti…
cloudpossebot Aug 6, 2024
a6da47e
Reorganize Sidebar and Add Section Intros (#633)
osterman Aug 7, 2024
4249e35
DEV-2453: Admonitions Processing (#642)
milldr Aug 7, 2024
2d80d52
Refine intro (#644)
osterman Aug 9, 2024
bc71121
DEV-2303: Prepare Workflows for Production (#645)
milldr Aug 9, 2024
ff76ae8
DEV-2459: Review and Improvements (#643)
milldr Aug 9, 2024
0d3caca
Merge branch 'master' into staging
milldr Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
108 changes: 108 additions & 0 deletions .github/actions/build-website/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build Cloud Posse Docs
inputs:
aws_region:
description: "AWS Region for credentials"
required: true
iam_role_arn:
description: "IAM Role ARN with access to S3 bucket origin"
required: true
iam_role_session_name:
description: "Session name to use to assume access to S3 bucket origin"
default: "cloudposse-docs-ci"
google_tag_manager:
description: "Google Tag Manager"
default: "GTM-ABCD123"
google_site_verification_id:
description: "Google Site verification ID"
default: "preview-github"
repo_access_token:
description: "GitHub Token used to access private repos"
required: true

runs:
using: composite
steps:
# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ inputs.aws_region }}
role-to-assume: ${{ inputs.iam_role_arn }}
role-session-name: ${{ inputs.iam_role_session_name }}

- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: "Checkout 'terraform-aws-components' Repository"
uses: actions/checkout@v4
with:
fetch-depth: 1
repository: cloudposse/terraform-aws-components
ref: main
path: tmp/components/terraform-aws-components

- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Cache rendered content
if: ${{ !contains(github.event.*.labels.*.name, 'no-cache') }}
uses: actions/cache@v4
with:
path: |
.build-harness
.cache
key: "build-website-cache" # Set same key to restore cache in all jobs

- name: "Initialize Build Harness"
shell: bash
run: |
make init

- name: "Install Python Dependencies"
shell: bash
run: |
pip install -r scripts/docs-collator/requirements.txt

- name: "Install terraform-docs"
uses: jaxxstorm/[email protected]
with:
repo: terraform-docs/terraform-docs
tag: v0.18.0
cache: enable

- name: "Render Documentation for Terraform Components"
shell: bash
run: |
./scripts/render-docs-for-components.sh

- name: "Render Documentation for Terraform Modules"
shell: bash
env:
PUBLIC_REPO_ACCESS_TOKEN: ${{ inputs.repo_access_token }}
run: |
./scripts/render-docs-for-modules.sh

- name: "Render Documentation for GitHub Actions"
shell: bash
env:
PUBLIC_REPO_ACCESS_TOKEN: ${{ inputs.repo_access_token }}
run: |
./scripts/render-docs-for-github-actions.sh

- name: Install Dependencies and Build Website
shell: bash
env:
GOOGLE_TAG_MANAGER: ${{ inputs.google_tag_manager }}
GOOGLE_SITE_VERIFICATION_ID: ${{ inputs.google_site_verification_id }}
run: |
make build-production
73 changes: 13 additions & 60 deletions .github/workflows/website-deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: "Website Deploy Preview"
name: "🚀 Docs Preview"

on:
workflow_dispatch:

pull_request:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- 'master'
- 'main'

env:
AWS_REGION: us-east-2
Expand All @@ -27,76 +30,26 @@ permissions:
contents: read

jobs:
website-deploy-preview:
# Do not deploy the website to the preview environment if the PR has the label 'website-no-deploy'
if: ${{ !contains(github.event.*.labels.*.name, 'website-no-deploy') }}

deploy:
runs-on: ubuntu-latest

environment:
name: preview
url: https://${{ env.DEPLOYMENT_HOST }}

steps:
# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.IAM_ROLE_ARN }}
role-session-name: ${{ env.IAM_ROLE_SESSION_NAME }}

- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: "Checkout 'terraform-aws-components' Repository"
uses: actions/checkout@v3
- name: Build Website
uses: ./.github/actions/build-website
with:
fetch-depth: 1
repository: cloudposse/terraform-aws-components
ref: main
path: tmp/components/terraform-aws-components

- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: "Install Python Dependencies"
run: |
make init
pip install -r scripts/docs-collator/requirements.txt

- name: "Render Documentation for Terraform Components"
run: |
./scripts/render-docs-for-components.sh

- name: "Render Documentation for Terraform Modules"
env:
PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
run: |
./scripts/render-docs-for-modules.sh

- name: "Render Documentation for GitHub Actions"
env:
PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
run: |
./scripts/render-docs-for-github-actions.sh

- name: Install Dependencies and Build Website
env:
GOOGLE_TAG_MANAGER: ${{ env.GOOGLE_TAG_MANAGER }}
GOOGLE_SITE_VERIFICATION_ID: ${{ env.GOOGLE_SITE_VERIFICATION_ID }}
run: |
make init
make build-production
aws_region: ${{ env.AWS_REGION }}
iam_role_arn: ${{ env.IAM_ROLE_ARN }}
iam_role_session_name: ${{ env.IAM_ROLE_SESSION_NAME }}
repo_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Copy Website to S3 Bucket PR Folder
run: |
Expand Down
51 changes: 40 additions & 11 deletions .github/workflows/website-deploy-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Website Deploy Release"
name: "🚀 Docs Release"

on:
workflow_dispatch:
Expand All @@ -10,20 +10,49 @@ on:
types:
- published

env:
AWS_REGION: us-east-2
IAM_ROLE_ARN: arn:aws:iam::557075604627:role/cplive-plat-ue2-prod-cloudposse-docs-gha
IAM_ROLE_SESSION_NAME: cloudposse-docs-ci-deploy-release
S3_BUCKET_NAME: cplive-plat-ue2-prod-cloudposse-docs-origin
DEPLOYMENT_HOST: docs.cloudposse.com
ALGOLIA_INDEX_NAME: docs.cloudposse.com
ALGOLIA_APP_ID: 32YOERUX83
GOOGLE_TAG_MANAGER: GTM-WQWH2XV
GOOGLE_SITE_VERIFICATION_ID: uY7FoBLCwsBfMMXefHxUz3lvHjZuWyURCIgpA-ia3_g

# These permissions are needed to interact with the GitHub's OIDC Token endpoint
permissions:
id-token: write
contents: read

jobs:
trigger_documentation_deployment:
deploy:
runs-on: ubuntu-latest

environment:
name: production
url: https://docs.cloudposse.com
name: staging
url: https://${{ env.DEPLOYMENT_HOST }}

steps:
- name: Trigger Documentation Deployment
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build Website
uses: ./.github/actions/build-website
with:
aws_region: ${{ env.AWS_REGION }}
iam_role_arn: ${{ env.IAM_ROLE_ARN }}
iam_role_session_name: ${{ env.IAM_ROLE_SESSION_NAME }}
google_tag_manager: ${{ env.GOOGLE_TAG_MANAGER }}
google_site_verification_id: ${{ env.GOOGLE_SITE_VERIFICATION_ID }}
repo_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Copy Website to S3 Bucket
run: |
curl \
-X POST \
-H "Authorization: Bearer ${{ secrets.TRIGGER_DOCS_REDEPLOY_WORKFLOW_REFARCH }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/cloudposse/refarch-scaffold/dispatches \
-d '{"event_type": "redeploy_documentation"}'
cd build
aws sts get-caller-identity
aws s3 sync . s3://${{ env.S3_BUCKET_NAME }} --delete --exclude "pr-*"
aws s3 ls s3://${{ env.S3_BUCKET_NAME }}/ --recursive --human-readable --summarize
61 changes: 61 additions & 0 deletions .github/workflows/website-deploy-staging-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "🚧 Staging Preview"

on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- 'staging'

env:
AWS_REGION: us-east-2
IAM_ROLE_ARN: arn:aws:iam::675539733138:role/cplive-plat-ue2-staging-cloudposse-docs-gha
IAM_ROLE_SESSION_NAME: cloudposse-docs-ci-deploy-pr-${{ github.event.pull_request.number }}
S3_BUCKET_NAME: cplive-plat-ue2-staging-cloudposse-docs-origin
PR_NUMBER: ${{ github.event.pull_request.number }}
DEPLOYMENT_HOST: pr-${{ github.event.pull_request.number }}.cloudposse-docs.ue2.staging.plat.cloudposse.org
ALGOLIA_INDEX_NAME: docs-preview.cloudposse.com
ALGOLIA_APP_ID: 32YOERUX83

# These permissions are needed to interact with the GitHub's OIDC Token endpoint
permissions:
id-token: write
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

environment:
name: preview
url: https://${{ env.DEPLOYMENT_HOST }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build Website
uses: ./.github/actions/build-website
with:
aws_region: ${{ env.AWS_REGION }}
iam_role_arn: ${{ env.IAM_ROLE_ARN }}
iam_role_session_name: ${{ env.IAM_ROLE_SESSION_NAME }}
repo_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Copy Website to S3 Bucket PR Folder
run: |
cd build
aws sts get-caller-identity
aws s3 sync . s3://${{ env.S3_BUCKET_NAME }}/pr-${{ env.PR_NUMBER }}/ --delete
aws s3 ls s3://${{ env.S3_BUCKET_NAME }}/pr-${{ env.PR_NUMBER }}/ --recursive --human-readable --summarize

- name: ReIndex with Algolia
if: ${{ contains(github.event.*.labels.*.name, 'reindex') }}
env:
ALGOLIA_SCRAPER_API_KEY: ${{ secrets.ALGOLIA_SCRAPER_API_KEY }}
run: |
./algolia/reindex.sh
55 changes: 55 additions & 0 deletions .github/workflows/website-deploy-staging-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "🚧 Staging Release"

on:
workflow_dispatch:

push:
branches:
- "staging"

env:
AWS_REGION: us-east-2
IAM_ROLE_ARN: arn:aws:iam::675539733138:role/cplive-plat-ue2-staging-cloudposse-docs-gha
IAM_ROLE_SESSION_NAME: cloudposse-docs-ci-deploy-staging
S3_BUCKET_NAME: cplive-plat-ue2-staging-cloudposse-docs-origin
DEPLOYMENT_HOST: cloudposse-docs.ue2.staging.plat.cloudposse.org
ALGOLIA_INDEX_NAME: cloudposse-docs.ue2.staging.plat.cloudposse.org
ALGOLIA_APP_ID: 32YOERUX83
GOOGLE_TAG_MANAGER: GTM-ABCD123
GOOGLE_SITE_VERIFICATION_ID: staging-github

# These permissions are needed to interact with the GitHub's OIDC Token endpoint
permissions:
id-token: write
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

environment:
name: staging
url: https://${{ env.DEPLOYMENT_HOST }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build Website
uses: ./.github/actions/build-website
with:
aws_region: ${{ env.AWS_REGION }}
iam_role_arn: ${{ env.IAM_ROLE_ARN }}
iam_role_session_name: ${{ env.IAM_ROLE_SESSION_NAME }}
google_tag_manager: ${{ env.GOOGLE_TAG_MANAGER }}
google_site_verification_id: ${{ env.GOOGLE_SITE_VERIFICATION_ID }}
repo_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Copy Website to S3 Bucket
run: |
cd build
aws sts get-caller-identity
aws s3 sync . s3://${{ env.S3_BUCKET_NAME }} --delete --exclude "pr-*"
aws s3 ls s3://${{ env.S3_BUCKET_NAME }}/ --recursive --human-readable --summarize
Loading
Loading