seahaven-site/.github/workflows/ci.yaml
Adam Moussa 3a8de4e88b
feat(ci): deploy the marketing site through the org static caller (PLAT-225) (#69)
* feat(ci): deploy the marketing site through the org static caller (PLAT-225)

Prod still ships on merge to main. Exec roles leave this workspace, and the deploy reads the bucket and distribution from SSM.

* fix(ci): run the static check after the legacy ci job

Both jobs call ci-static, which cancels the other in-progress run on the same ref, so ci-complete never saw both succeed.

* fix(ci): address review feedback

* fix(ci): address review feedback

* fix(ci): address review feedback

* fix(ci): address review feedback
2026-09-25 15:18:40 +00:00

70 lines
2.5 KiB
YAML

name: CI
# Parallel static-site and Terraform portions. ci-complete is the check the
# CI complete ruleset requires. The ci job remains so main branch protection
# still sees ci / ci until this repo is moved onto that ruleset.
on:
pull_request:
branches: [main, hotfix/**, release/**]
merge_group:
push:
branches: [hotfix/**, release/**]
permissions:
contents: read
jobs:
autofix:
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
uses: Sea-Haven-Industries/.github/.github/workflows/ci-autofix.yaml@0a1010e63248c9ca9f042c870eb2c579ba6b9455 # v1.0.19
permissions:
contents: write
secrets: inherit
with:
presets: terraform
ci:
needs: autofix
if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
uses: Sea-Haven-Industries/.github/.github/workflows/ci-static.yaml@0a1010e63248c9ca9f042c870eb2c579ba6b9455 # v1.0.19
with:
build-command: "npx @11ty/eleventy"
check-dir: "_site"
# ci-static cancels other in-progress runs of this workflow on the same ref.
# Run after the legacy ci job so both calls can finish.
static:
needs: [autofix, ci]
if: always() && !cancelled() && needs.ci.result == 'success' && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
uses: Sea-Haven-Industries/.github/.github/workflows/ci-static.yaml@0a1010e63248c9ca9f042c870eb2c579ba6b9455 # v1.0.19
with:
build-command: "npx @11ty/eleventy"
check-dir: "_site"
terraform:
needs: autofix
if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
uses: Sea-Haven-Industries/.github/.github/workflows/ci-terraform.yaml@0a1010e63248c9ca9f042c870eb2c579ba6b9455 # v1.0.19
with:
terraform-version: "1.16.0"
ci-complete:
name: ci-complete
needs: [autofix, ci, static, terraform]
if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require portions
env:
AUTOFIX: ${{ needs.autofix.result }}
CI: ${{ needs.ci.result }}
STATIC: ${{ needs.static.result }}
TERRAFORM: ${{ needs.terraform.result }}
run: |
set -euo pipefail
test "${AUTOFIX}" = success -o "${AUTOFIX}" = skipped
test "${CI}" = success
test "${STATIC}" = success
test "${TERRAFORM}" = success