Set up a GitHub Actions workflow to upload Lambda artifacts to the environment S3 bucket.
When you create an environment, Gapstack automatically creates two resources in your AWS account and region:
An S3 bucket for artifacts
An OpenID Connect (OIDC) IAM role so GitHub Actions can authenticate to AWS without long-lived access keys
Copy the bucket name and role from the environment Details page. Store those values as GitHub Actions variables, then add the following steps to your workflow.
Do not store AWS access keys in GitHub. Use the OIDC role from the environment.
1
Copy values from the environment Details page
Open the environment in Gapstack and click Details. Copy these fields:
OpenID Role → ROLE_TO_ASSUME
Artifacts → BUCKET_SOURCE
Region → AWS_REGION
The environment name → ENVIRONMENT and STAGE
Use the copy icon next to each field.
Copy OpenID Role and Artifacts from the environment Details page.
2
Add GitHub Actions variables
Add the values you copied as repository variables so the workflow can read them.
In GitHub, open the repository.
Click Settings.
Click Secrets and variables, then Actions.
Open the Variables tab.
Click New repository variable for each variable below.
Name
Value
AWS_REGION
Region on the environment Details page (for example us-west-1)
ENVIRONMENT
The environment name (for example prod)
STAGE
The stage name (for example prod)
BUCKET_SOURCE
Artifacts on the environment Details page
ROLE_TO_ASSUME
OpenID Role on the environment Details page
3
Set environment variables
Add an env block at the top of the workflow. It reads the repository variables you created.