Skip to content

Commit

Permalink
Merge pull request #219 from GSA-TTS/main
Browse files Browse the repository at this point in the history
Deploy to staging
  • Loading branch information
danielnaab authored Jul 10, 2024
2 parents c5d42ac + 8c8994d commit fed86ca
Show file tree
Hide file tree
Showing 129 changed files with 3,240 additions and 925 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/_docker-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ on:
repo-name:
type: string
default: ${{ github.event.repository.name }}
tag-name:
type: string
default: ${{ github.ref_name }}

env:
TAG_NAME: ${{ github.ref_name }}
TAG_NAME: ${{ inputs.tag-name }}
APP_DIR: ${{ inputs.app-name }}
REGISTRY_PATH: ghcr.io/${{ inputs.org-name }}/${{ inputs.repo-name }}/${{ inputs.app-name }}
COMMIT_SHA: ${{github.sha}}
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/_playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Playwright Tests
on:
workflow_call:
jobs:
end_to_end:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm --filter=end-to-end-tests exec playwright install --with-deps
- name: Debugging steps
run: |
echo "Workflow triggered in branch '${{ github.ref }}'."
echo "Workflow triggered in head_ref '${{ github.head_ref }}'."
echo "Workflow triggered by event '${{ github.event_name }}'."
echo "Workflow triggered by actor '${{ github.actor }}''."
- name: Determine E2E_ENDPOINT
run: >
echo E2E_ENDPOINT=$(if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.head_ref }}" != "main" ]]; then
echo "${{ vars.PREVIEW_URL }}/${{ github.head_ref }}";
else
echo "${{ vars.MAIN_URL }}";
fi) >> $GITHUB_ENV
- name: Run Playwright tests
run: pnpm --filter=end-to-end-tests exec playwright test
env:
E2E_ENDPOINT: ${{ env.E2E_ENDPOINT }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion .github/workflows/_terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_terraform-plan-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
Expand All @@ -45,13 +45,18 @@ jobs:
- name: Install dependencies
run: pnpm install

# While most of the test suite is self-contained, the tests for the demo
# servers require a prod build of @atj/server.
- name: Build
run: pnpm build

- name: Lint source code
shell: bash
run: pnpm lint

- name: Run test suite
shell: bash
run: pnpm test
run: pnpm test:ci

- name: Initialize Terraform CDK configuration
shell: bash
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ jobs:
uses: ./.github/workflows/_docker-build-image.yml
secrets: inherit
with:
app-name: doj-demo
app-name: server-doj
tag-name: ${{ github.ref_name }}

build-image-spotlight:
build-image-kansas:
uses: ./.github/workflows/_docker-build-image.yml
secrets: inherit
with:
app-name: spotlight
app-name: server-kansas
tag-name: ${{ github.ref_name }}

deploy:
needs: [build-image-doj, build-image-spotlight]
needs: [build-image-doj, build-image-kansas]
uses: ./.github/workflows/_terraform-apply.yml
secrets: inherit
with:
deploy-env: ${{ github.ref_name }}
deploy-env: ${{ github.ref_name }}
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/_validate.yml
e2e:
needs: [run-tests]
uses: ./.github/workflows/_playwright.yml
secrets: inherit
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ node_modules/
NOTES.md
tsconfig.tsbuildinfo
*storybook.log
packages/form-service
packages/form-service
/e2e/test-results/
/e2e/playwright-report/
/e2e/blob-report/
/e2e/playwright/.cache/
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pnpm lint
pnpm format
pnpm test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.12.2
v20.15.0
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ RUN pnpm build
RUN pnpm --filter=$APP_DIR --prod deploy /app/$APP_DIR

FROM base AS app
ARG APP_DIR=doj-demo
ARG APP_DIR

LABEL org.opencontainers.image.description 10x-atj DOJ demo
LABEL org.opencontainers.image.description 10x Access to Justice Form Builder

COPY --from=build /app/$APP_DIR /app/$APP_DIR
COPY --from=build /usr/src/app/apps/$APP_DIR/dist /app/$APP_DIR/dist
Expand All @@ -28,7 +28,7 @@ ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321

CMD [ "node", "./dist/server/entry.mjs" ]
CMD [ "node", "./dist/index.js" ]

#HEALTHCHECK --interval=5m --timeout=3s \
# CMD curl -f http://localhost:4321/ || exit 1
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ Test bed for ATJ platform tooling, completed as part of the [10x Digital Access

## Overview

The project dependencies within the workspace are:

![workspace project dependencies](./workspace-dependencies.svg)
The workspace dependencies are depicted in this auto-generated [workspace project dependencies graph](./workspace-dependencies.svg).

Additional documentation:

Expand All @@ -26,12 +24,18 @@ The platform is made up of the following high-level terms.

- **Blueprint**: produced by a content author, the blueprint defines the structure of an interactive session between a court and an SRL
- **Conversation**: one instance of a blueprint; the interactive session between a court and an SRL. Other terms for this concept include dialogue or session.
- **Pattern**: the building blocks of a blueprint, patterns implement UX best-practices, defining the content and behavior of the user interface.
- **Pattern/template**: the building blocks of a blueprint, patterns implement UX best-practices, defining the content and behavior of the user interface.
- **Prompt**: produced by a pattern, the prompt defines what is presented to the end user at single point in a conversation.
- **Component**: user interface component that acts as the building block of prompts.

## Development

This project uses the version of Node.js defined in [.nvmrc](./nvmrc). To ensure you're using the correct node version, you may use the [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm):

```bash
nvm install
```

This project uses [pnpm workspaces](https://pnpm.io/workspaces). To work with this project, [install pnpm](https://pnpm.io/installation) and then the project dependencies:

```bash
Expand Down
47 changes: 0 additions & 47 deletions apps/doj-demo/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions apps/doj-demo/src/components/AppAvailableFormList.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions apps/doj-demo/src/components/AppFormManager.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions apps/doj-demo/src/components/AppFormRouter.tsx

This file was deleted.

51 changes: 0 additions & 51 deletions apps/doj-demo/src/components/Header.astro

This file was deleted.

Loading

0 comments on commit fed86ca

Please sign in to comment.