Skip to content

Commit 7152372

Browse files
authored
Develop (#171)
* Synching develop branch with master. (#161) * Feature/157 (#158) * Initial creation of terraform setup for AWS static-content site hosting. * Website deployment run locally works. Terraform AWS resource build run locally works. * Creating test self-hosted environment. Alwways run terraform in docker containers. * Removing all run on PR creation / modification. * Making redirect_uri and logout URL field defaults parameterized. * OIDC Authorization Code Flow with local keycoak is now working for test and prod hosted static-content site. * Updating Token History grouping. * Test suite works against test and prod sites with a local keycloak instance. The introspection endpoint in keycloak cannot be invoked from the browser. So, the static content site cannot call the keycloak instrospection site. The test suite looks for hte expected CORS error. Test suite must be run against a local build for full validation. * Feature/158 (#160) * Initial creation of terraform setup for AWS static-content site hosting. * Website deployment run locally works. Terraform AWS resource build run locally works. * Creating test self-hosted environment. Alwways run terraform in docker containers. * Removing all run on PR creation / modification. * Making redirect_uri and logout URL field defaults parameterized. * OIDC Authorization Code Flow with local keycoak is now working for test and prod hosted static-content site. * Updating Token History grouping. * Test suite works against test and prod sites with a local keycloak instance. The introspection endpoint in keycloak cannot be invoked from the browser. So, the static content site cannot call the keycloak instrospection site. The test suite looks for hte expected CORS error. Test suite must be run against a local build for full validation. * Minimize javascript for static content sites. Google analytics for static content sites. * feature/152 (#163) * Feature/157 (#158) * Initial creation of terraform setup for AWS static-content site hosting. * Website deployment run locally works. Terraform AWS resource build run locally works. * Creating test self-hosted environment. Alwways run terraform in docker containers. * Removing all run on PR creation / modification. * Making redirect_uri and logout URL field defaults parameterized. * OIDC Authorization Code Flow with local keycoak is now working for test and prod hosted static-content site. * Updating Token History grouping. * Test suite works against test and prod sites with a local keycloak instance. The introspection endpoint in keycloak cannot be invoked from the browser. So, the static content site cannot call the keycloak instrospection site. The test suite looks for hte expected CORS error. Test suite must be run against a local build for full validation. * Feature/158 (#160) * Initial creation of terraform setup for AWS static-content site hosting. * Website deployment run locally works. Terraform AWS resource build run locally works. * Creating test self-hosted environment. Alwways run terraform in docker containers. * Removing all run on PR creation / modification. * Making redirect_uri and logout URL field defaults parameterized. * OIDC Authorization Code Flow with local keycoak is now working for test and prod hosted static-content site. * Updating Token History grouping. * Test suite works against test and prod sites with a local keycloak instance. The introspection endpoint in keycloak cannot be invoked from the browser. So, the static content site cannot call the keycloak instrospection site. The test suite looks for hte expected CORS error. Test suite must be run against a local build for full validation. * Minimize javascript for static content sites. Google analytics for static content sites. * Feature/152 (#162) * Synching develop branch with master. (#161) * Feature/157 (#158) * Initial creation of terraform setup for AWS static-content site hosting. * Website deployment run locally works. Terraform AWS resource build run locally works. * Creating test self-hosted environment. Alwways run terraform in docker containers. * Removing all run on PR creation / modification. * Making redirect_uri and logout URL field defaults parameterized. * OIDC Authorization Code Flow with local keycoak is now working for test and prod hosted static-content site. * Updating Token History grouping. * Test suite works against test and prod sites with a local keycloak instance. The introspection endpoint in keycloak cannot be invoked from the browser. So, the static content site cannot call the keycloak instrospection site. The test suite looks for hte expected CORS error. Test suite must be run against a local build for full validation. * Feature/158 (#160) * Initial creation of terraform setup for AWS static-content site hosting. * Website deployment run locally works. Terraform AWS resource build run locally works. * Creating test self-hosted environment. Alwways run terraform in docker containers. * Removing all run on PR creation / modification. * Making redirect_uri and logout URL field defaults parameterized. * OIDC Authorization Code Flow with local keycoak is now working for test and prod hosted static-content site. * Updating Token History grouping. * Test suite works against test and prod sites with a local keycloak instance. The introspection endpoint in keycloak cannot be invoked from the browser. So, the static content site cannot call the keycloak instrospection site. The test suite looks for hte expected CORS error. Test suite must be run against a local build for full validation. * Minimize javascript for static content sites. Google analytics for static content sites. * Updated docker build instructions. * Initial page + test creation. (#164) * Initial page + test creation. * Adding ability to take a JWT and decompose it into JWT Header and JWT Payload fields on jwt_tools.html page. Updated test suite to test this. * Moving back to postgres18. Not sure when we lost that change. * Fixing test #13. * Fix coverage report. * Another change attempting to fix the code coverage bug. * Successful deployment to test.idptools.com and selenium test run. * Terraform creates IAM role with minimmum permissions. * Terraform creates IAM role with minimmum permissions. * Automatically run terraform against test when commmits / merge made to develop. * Updating develop / test 'test suite run' + terraform + static-content site deployment. * Test change to kick off pipelines. * Kick-off another workflow run. * Terraform deploy job didn't run as expected on push.
1 parent b34e590 commit 7152372

2 files changed

Lines changed: 63 additions & 31 deletions

File tree

.github/workflows/terraform.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@ name: Terraform
33
# Runs Terraform inside the same container image used locally
44
# (infra/terraform-local.sh). State is remote (S3).
55
#
6-
# Triggers:
7-
# - workflow_run after "Selenium Tests" succeeds on develop -> automatically
8-
# `apply` the TEST environment. On a develop push the pipeline is:
9-
# Selenium Tests -> Terraform (this) -> Deploy test.idptools.com.
10-
# - workflow_dispatch -> manual run; choose environment (test|prod) and
11-
# action (plan|apply), e.g. to apply prod.
6+
# Manual dispatch ONLY: choose environment (test|prod) and action (plan|apply),
7+
# e.g. to apply prod, or plan/apply test on demand.
128
#
13-
# Deliberately NOT triggered on push/pull_request directly: develop changes go
14-
# through the test suite first, and PR content is never run with credentials.
9+
# The AUTOMATIC develop pipeline (apply TEST infra, then deploy the test site)
10+
# lives in the "Deploy Static Site (test.idptools.com)" workflow, which runs
11+
# terraform + deploy as ordered jobs after the Selenium Tests suite passes.
12+
# Terraform is NOT auto-run here on develop because chaining terraform -> deploy
13+
# across separate workflow_run workflows is unreliable: a workflow_run-triggered
14+
# run is attributed to the default branch, so the develop branch/SHA is lost on
15+
# the second hop.
1516
#
16-
# CI authenticates with static-key secrets (same pattern as the deploy
17-
# pipeline); local runs use your AWS SSO session.
18-
#
19-
# NOTE: workflow_run triggers only fire when this workflow file exists on the
20-
# repository's DEFAULT branch (master). Merge to the default branch for the
21-
# chain to take effect.
17+
# CI authenticates with static-key secrets; local runs use your AWS SSO session.
2218

2319
on:
2420
# Run after the Selenium Tests suite passes for a develop push.

.github/workflows/website-deploy-test.yml

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,73 @@
11
name: Deploy Static Site (test.idptools.com)
22

3-
# Builds the static client content and deploys it to the TEST site
4-
# (test.idptools.com) using the same container image as prod and local runs.
5-
# DEPLOY_ENV=test selects the test bucket / distribution / config.
3+
# Automatic develop pipeline, chained after the Selenium Tests suite:
64
#
7-
# Ordering: chained AFTER the "Terraform" workflow via `workflow_run`. On a
8-
# develop push the full pipeline is:
9-
# Selenium Tests -> Terraform apply (test) -> Deploy (this).
10-
# The test suite runs once, in the "Selenium Tests" workflow; this deploy only
11-
# happens if that suite passed and Terraform then applied successfully.
5+
# Selenium Tests --(workflow_run, develop, success)--> this workflow
6+
# job: terraform -> apply the TEST infrastructure
7+
# job: deploy -> build + deploy TEST content to S3/CloudFront, then tag
8+
# (needs: terraform)
129
#
13-
# NOTE: workflow_run triggers only fire when this workflow file exists on the
14-
# repository's DEFAULT branch (master). Merge to the default branch for the
15-
# chain to take effect.
10+
# Terraform and deploy are ORDERED JOBS in ONE workflow (not a second
11+
# workflow_run hop). A workflow_run-triggered run is attributed to the default
12+
# branch, so chaining terraform -> deploy across separate workflows loses the
13+
# develop branch/SHA. Chaining a single hop from Selenium Tests keeps it: both
14+
# jobs check out the exact develop commit the suite tested
15+
# (github.event.workflow_run.head_sha).
16+
#
17+
# The Selenium Tests suite runs once (in its own workflow) and gates this one.
18+
#
19+
# NOTE: workflow_run triggers only fire from the workflow file on the DEFAULT
20+
# branch (master) — keep this file updated there.
1621

1722
on:
18-
# Run after the Terraform workflow completes for a develop push.
23+
# Run after the Selenium Tests suite completes for a develop push.
1924
workflow_run:
20-
workflows: ["Terraform"]
25+
workflows: ["Selenium Tests"]
2126
types: [completed]
2227
branches: [develop]
23-
# Still allow manual deploys.
28+
# Manual full run (apply TEST infra + deploy).
2429
workflow_dispatch:
2530

2631
permissions:
2732
# write is needed to push the deploy tag back to the repo.
2833
contents: write
2934

3035
jobs:
36+
# ---- Apply the TEST infrastructure first ----
37+
terraform:
38+
runs-on: ubuntu-latest
39+
# For a workflow_run trigger, only proceed if the suite succeeded on develop.
40+
# Manual dispatch always proceeds.
41+
if: >-
42+
${{ github.event_name == 'workflow_dispatch' ||
43+
(github.event.workflow_run.conclusion == 'success' &&
44+
github.event.workflow_run.head_branch == 'develop') }}
45+
steps:
46+
- name: Checkout Repository
47+
uses: actions/checkout@v5
48+
with:
49+
# The exact commit the suite tested (workflow_run) or the dispatch ref.
50+
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}
51+
52+
- name: Build terraform image
53+
run: docker build -t idptools-terraform -f infra/Dockerfile .
54+
55+
- name: Terraform apply (test)
56+
env:
57+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
58+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
59+
run: |
60+
docker run --rm \
61+
-e AWS_ACCESS_KEY_ID \
62+
-e AWS_SECRET_ACCESS_KEY \
63+
-e AWS_REGION=us-west-2 \
64+
-e TF_ENV=test \
65+
-e TF_ACTION=apply \
66+
idptools-terraform
67+
68+
# ---- Then build + deploy the static content (only if terraform succeeded) ----
3169
deploy:
70+
needs: terraform
3271
runs-on: ubuntu-latest
3372
# For a workflow_run trigger, only deploy if Terraform succeeded on develop.
3473
# Manual dispatch always proceeds.
@@ -40,9 +79,6 @@ jobs:
4079
- name: Checkout Repository
4180
uses: actions/checkout@v5
4281
with:
43-
# A workflow_run-triggered job checks out the default branch by
44-
# default; check out the exact commit the chain ran against so the
45-
# deployed content matches. Manual dispatch uses its own ref.
4682
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}
4783

4884
- name: Build deploy image

0 commit comments

Comments
 (0)