Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/cloud-smoke-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Cloud smoke cleanup

on:
workflow_run:
workflows:
- Cloud smoke tests
types:
- completed

permissions:
contents: read
id-token: write

jobs:
cleanup:
name: Destroy ${{ matrix.name }}
if: github.event.workflow_run.head_repository.full_name == github.repository && contains(fromJSON('["failure","cancelled","timed_out"]'), github.event.workflow_run.conclusion)
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: DigitalOcean ISLE
provider: digitalocean
template: isle
- name: Linode WordPress
provider: linode
template: wp
- name: GCP WordPress
provider: gcp
template: wp
concurrency:
group: cloud-compose-smoke-${{ matrix.provider }}-${{ matrix.template }}
cancel-in-progress: false
env:
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.event.workflow_run.id }}
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
GCLOUD_OIDC_POOL: ${{ vars.GCLOUD_OIDC_POOL || secrets.GCLOUD_OIDC_POOL }}
GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT || secrets.GCLOUD_PROJECT }}
GCLOUD_REGION: ${{ vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
GSA: ${{ vars.GSA || secrets.GSA }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Authenticate to Google Cloud
if: matrix.provider == 'gcp' && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != ''
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: ${{ env.GCLOUD_OIDC_POOL }}
service_account: ${{ env.GSA }}
project_id: ${{ env.GCLOUD_PROJECT }}

- name: Install gcloud
if: matrix.provider == 'gcp' && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != ''
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3

- name: Sweep smoke resources
if: matrix.provider != 'gcp' || (env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != '')
run: ci/cloud-smoke.sh sweep-${{ matrix.provider }}-${{ matrix.template }}

- name: Skip GCP cleanup
if: matrix.provider == 'gcp' && (env.GCLOUD_OIDC_POOL == '' || env.GSA == '' || env.GCLOUD_PROJECT == '')
run: echo "Skipping GCP cleanup because GCP smoke secrets are not configured."
162 changes: 162 additions & 0 deletions .github/workflows/cloud-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Cloud smoke tests

on:
pull_request:
branches:
- main

permissions:
contents: read
id-token: write

concurrency:
group: cloud-compose-smoke
cancel-in-progress: true

jobs:
terraform-lint:
name: Terraform lint
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.6
terraform_wrapper: false

- name: Run Terraform lint
run: make terraform-lint-check

smoke:
name: ${{ matrix.name }}
needs: terraform-lint
runs-on: ubuntu-24.04
timeout-minutes: 150
if: github.event.pull_request.head.repo.full_name == github.repository
strategy:
fail-fast: false
matrix:
include:
- name: DigitalOcean ISLE
provider: digitalocean
template: isle
- name: Linode WordPress
provider: linode
template: wp
- name: GCP WordPress
provider: gcp
template: wp
concurrency:
group: cloud-compose-smoke-${{ matrix.provider }}-${{ matrix.template }}
cancel-in-progress: false
env:
CLOUD_COMPOSE_SMOKE_AUTO_APPROVE: "true"
CLOUD_COMPOSE_SMOKE_DESTROY_TIMEOUT: "1800"
CLOUD_COMPOSE_SMOKE_SWEEP_ORPHANS: "true"
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
CLOUD_COMPOSE_SOURCE_REF: ${{ github.event.pull_request.head.sha }}
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
GCLOUD_OIDC_POOL: ${{ vars.GCLOUD_OIDC_POOL || secrets.GCLOUD_OIDC_POOL }}
GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT || secrets.GCLOUD_PROJECT }}
GCLOUD_REGION: ${{ vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
GSA: ${{ vars.GSA || secrets.GSA }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.6
terraform_wrapper: false

- name: Check GCP smoke secrets
if: matrix.provider == 'gcp'
run: |
test -n "$GCLOUD_OIDC_POOL" || { echo "GCLOUD_OIDC_POOL Actions variable or secret is required for GCP smoke tests"; exit 1; }
test -n "$GSA" || { echo "GSA Actions variable or secret is required for GCP smoke tests"; exit 1; }
test -n "$GCLOUD_PROJECT" || { echo "GCLOUD_PROJECT Actions variable or secret is required for GCP smoke tests"; exit 1; }

- name: Authenticate to Google Cloud
if: matrix.provider == 'gcp'
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: ${{ env.GCLOUD_OIDC_POOL }}
service_account: ${{ env.GSA }}
project_id: ${{ env.GCLOUD_PROJECT }}

- name: Install gcloud
if: matrix.provider == 'gcp'
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3

- name: Install sitectl
run: ci/install-sitectl-apt.sh

- name: Run smoke test
run: make smoke-test PROVIDER=${{ matrix.provider }} TEMPLATE=${{ matrix.template }}

- name: Destroy smoke resources
if: always() && (matrix.provider != 'gcp' || (env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != ''))
run: ci/cloud-smoke.sh destroy-${{ matrix.provider }}-${{ matrix.template }}

- name: Skip GCP destroy
if: always() && matrix.provider == 'gcp' && (env.GCLOUD_OIDC_POOL == '' || env.GSA == '' || env.GCLOUD_PROJECT == '')
run: echo "Skipping GCP destroy because GCP smoke secrets are not configured and no GCP resources were applied."

cleanup:
name: Destroy ${{ matrix.name }}
needs: smoke
if: always() && (failure() || cancelled())
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: DigitalOcean ISLE
provider: digitalocean
template: isle
- name: Linode WordPress
provider: linode
template: wp
- name: GCP WordPress
provider: gcp
template: wp
concurrency:
group: cloud-compose-smoke-${{ matrix.provider }}-${{ matrix.template }}
cancel-in-progress: false
env:
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
GCLOUD_OIDC_POOL: ${{ vars.GCLOUD_OIDC_POOL || secrets.GCLOUD_OIDC_POOL }}
GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT || secrets.GCLOUD_PROJECT }}
GCLOUD_REGION: ${{ vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
GSA: ${{ vars.GSA || secrets.GSA }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Authenticate to Google Cloud
if: matrix.provider == 'gcp' && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != ''
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: ${{ env.GCLOUD_OIDC_POOL }}
service_account: ${{ env.GSA }}
project_id: ${{ env.GCLOUD_PROJECT }}

- name: Install gcloud
if: matrix.provider == 'gcp' && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != ''
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3

- name: Sweep smoke resources
if: matrix.provider != 'gcp' || (env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != '')
run: ci/cloud-smoke.sh sweep-${{ matrix.provider }}-${{ matrix.template }}

- name: Skip GCP cleanup
if: matrix.provider == 'gcp' && (env.GCLOUD_OIDC_POOL == '' || env.GSA == '' || env.GCLOUD_PROJECT == '')
run: echo "Skipping GCP cleanup because GCP smoke secrets are not configured."
40 changes: 40 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Build docs"

on:
push:
branches:
- main
paths:
- "docs/**"
- ".github/workflows/docs.yml"
- "Makefile"

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Build docs
run: make docs-build

- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6

- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: ./docs/site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ override.tf
override.tf.json
*_override.tf
*_override.tf.json
site/
docs/site/
docs/.cache/
.cloud-compose-smoke/
45 changes: 45 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading