GitHub Actions
This guide shows you how to start LocalStack in a Github Actions job.
In order to start LocalStack, we recommend to start it in a separate build step, to separate its log output / status from the rest of your job.
We recommend taking the following steps:
- Install the LocalStack CLI (and maybe also ).
- Use the LocalStack CLI to start LocalStack. Make sure to use the
-d
flag to start the LocalStack docker container in detached mode.
The following example can be integrated into your GitHub workflow. As an example, it will use awslocal to create bucket and list it afterwards.
If you want to add further configuration for LocalStack, you can use the section of your build step to set the configuration variables as described .
Activating LocalStack Pro
If you want to use LocalStack Pro in your GitHub Actions job, you should use a to store your API key securely. In the above example, you can see us setting the LOCALSTACK_API_KEY
environment variable to the value of the secret .
There, you create the secret for your API key like in the following image, replacing foobar
with your API key.