Skip to content

Commit f198820

Browse files
authored
docs: Updated shared services documentation to match new deployment process. (#43)
1 parent d281d39 commit f198820

File tree

3 files changed

+60
-22
lines changed

3 files changed

+60
-22
lines changed

docs/assets/app-deployment-workflow.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
environment: ${{ inputs.environment }}
3030
steps:
3131
- name: Checkout code
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v6
3333
- name: Configure AWS credentials
3434
uses: aws-actions/configure-aws-credentials@v4
3535
with:
@@ -64,11 +64,19 @@ jobs:
6464
--name /$APPLICATION/$ENVIRONMENT/web/version \
6565
--value "$IMAGE_TAG" \
6666
--overwrite
67+
- name: Get a deployment token
68+
uses: actions/create-github-app-token@v2
69+
id: token
70+
with:
71+
app-id: ${{ secrets.DEPLOYMENT_APP_ID }}
72+
private-key: ${{ secrets.DEPLOYMENT_APP_KEY }}
73+
owner: codeforamerica
74+
repositories: shared-services-infra
6775
- name: Trigger deployment from shared services
68-
uses: codex-/return-dispatch@v2
76+
uses: codex-/return-dispatch@v3
6977
id: dispatch
7078
with:
71-
token: ${{ secrets.DEPLOYMENT_PAT }}
79+
token: ${{ steps.token.outputs.token }}
7280
ref: ${{ inputs.shared_services_ref || 'main' }}
7381
repo: shared-services-infra
7482
owner: codeforamerica
@@ -86,7 +94,7 @@ jobs:
8694
workflow: ${{ steps.dispatch.outputs.run_id }}
8795
- name: Fail unless the workflow succeeded
8896
if: ${{ steps.waiter.outputs.conclusion != 'success' }}
89-
uses: actions/github-script@v7
97+
uses: actions/github-script@v8
9098
with:
9199
script: |
92100
core.setFailed('Deployment workflow completed with stats: ${{ steps.waiter.outputs.conclusion }}')

docs/services/hosting/deployment-workflow.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,54 @@ Follow the steps below to add the workflow to your repository:
3030
1. Add your additional build steps, as needed, before the
3131
`Build and push Docker image` step
3232

33-
## Environment
33+
## Secrets and variables
3434

3535
> [!TIP]
36-
> The DevOps team will create the initial environment for you and set the
37-
> appropriate secrets and variables. You can then modify the environment as
38-
> needed.
36+
> The DevOps team will set the appropriate secrets and variables documented
37+
> below. You can add additional secrets and variables that shoudl be synced to
38+
> GitHub.
3939
40-
For this workflow to function correctly, you will need to set up one or more
41-
environments for it be run against. The environment should include the following
42-
secrets and variables:
40+
We use [Doppler] to manage secrets across projects and environments. If you
41+
don't already have a Doppler project and environment, one will be created for
42+
you. Secrets from the `ci` environment will be synced to GitHub Environments
43+
for use in GitHub Actions.
4344

44-
### Secrets
45+
In addition to the secrets added directly to the `ci` environment, an
46+
[inherited config][config-inheritance] will be added, which will add the values
47+
needed to deploy the application.
4548

46-
| Name | Description |
47-
|-------------------------|-----------------------------------------------------------------------|
48-
| `AWS_ACCESS_KEY_ID` | AWS access key ID with access to the shared services environment. |
49-
| `AWS_SECRET_ACCESS_KEY` | AWS secret access key with access to the shared services environment. |
49+
### Direct secrets
5050

51-
### Variables
51+
The following secrets are used push container images, and update the version
52+
SSM parameter. They are unique to your project and environment and provide
53+
minmal access.
5254

53-
| Name | Description |
54-
|--------------|------------------------------------------------------------------|
55-
| `AWS_REGION` | The AWS region where the shared services environment is located. |
55+
| Name | Description |
56+
|---------------------------|-----------------------------------------------------------------------|
57+
| `AWS_ACCESS_KEY_ID` | AWS access key ID with access to the shared services environment. |
58+
| `AWS_SECRET_ACCESS_KEY` | AWS secret access key with access to the shared services environment. |
59+
60+
61+
### Inherited secrets
62+
63+
These secrets are inherited from the shared services project and managed by the
64+
DevOps team. They allow your repository to trigger the application deployment
65+
workflow on the sahred services repository.
66+
67+
| Name | Description |
68+
|-----------------------|------------------------------------------------------|
69+
| `DEPLOYMENT_APP_ID` | ID of the GitHub App used for authorization. |
70+
| `DEPLOYMENT_APP_KEY` | Private key to authenticate with the GitHub App. |
71+
72+
### Inherited variables
73+
74+
Like the secrets above, these variables are inherited from teh shared services
75+
project. They represent insecure values necessary to identify the target of
76+
deployments.
77+
78+
| Name | Description |
79+
|---------------|------------------------------------------------------------------|
80+
| `AWS_REGION` | The AWS region where the shared services environment is located. |
5681

5782
## How it works
5883

@@ -106,6 +131,8 @@ sequenceDiagram
106131
--8<-- "docs/assets/app-deployment-workflow.yaml"
107132
```
108133

134+
[config-inheritance]: https://docs.doppler.com/docs/config-inheritance
135+
[doppler]: https://www.doppler.com/
109136
[review]: usage.md#review-and-setup
110137

111138
[^1]: By default, the new version is based on the latest SHA. You may want to

docs/services/hosting/usage.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ that describes the application, its containers, volumes, and other settings.
2222
The DevOps team will review the pull request and, once approved, will create
2323
resources in your repository that will allow you to deploy your application.
2424

25-
- A repository secret named `DEPLOYMENT_PAT` that will be used to start the
26-
shared services deployment workflow
25+
> [!NOTE]
26+
> The GitHub environment and secrets mentioned below are managed by Doppler.
27+
28+
- Environment secrets named `DEPLOYMENT_APP_ID` and `DEPLOYMENT_APP_KEY` will
29+
be used to start the shared services deployment workflow
2730
- A `development` environment, if one does not already exist, that will be used
2831
to build and push updated docker images for the application
2932
- `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment secrets that are

0 commit comments

Comments
 (0)