You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: content/en/user-guide/cloud-sandbox/application-previews/index.md
+62-82Lines changed: 62 additions & 82 deletions
Original file line number
Diff line number
Diff line change
@@ -7,116 +7,96 @@ description: Create an Application Preview to deploy your application changes in
7
7
8
8
## Introduction
9
9
10
-
Application Preview allows you to generate an preview environment from GitHub Pull Request (PR) builds.
11
-
You can use Application Preview to temporarily deploy your AWS-powered application to a LocalStack Ephemeral Instance and preview your application changes.
12
-
Currently, the Application Preview are only supported for GitHub repositories using GitHub Actions.
10
+
Application Preview generates a preview environment from GitHub Pull Requests (PRs).
11
+
It allows temporary deployment of AWSpowered applications on a LocalStack Ephemeral Instance to preview changes.
12
+
This feature is currently only available for GitHub repositories that use GitHub Actions.
13
13
14
14
{{< callout >}}
15
-
Application Preview is currently available on invite-only preview.
16
-
If you'd like to try it out, please [contact us](https://www.localstack.cloud/demo) to request access.
15
+
Ephemeral Instances is offered as a **preview** feature and under active development.
17
16
{{< /callout >}}
18
17
19
18
## Getting started
20
19
21
20
This guide is designed for users new to Application Preview and assumes basic knowledge of GitHub Actions.
22
21
We will configure a CI pipeline that runs on pull requests using GitHub Actions.
23
22
24
-
To get started with a ready-to-use template, you can fork the [`bref-localstack-sample`](https://github.com/localstack-samples/bref-localstack-sample) repository.
25
-
The sample application deploys a serverless PHP application using Bref and the Serverless Framework.
To create an Application Preview, you can use the [`LocalStack/setup-localstack/ephemeral/startup` action](https://github.com/localstack/setup-localstack).
30
+
To create an Application Preview, use the [`LocalStack/setup-localstack` action](https://github.com/localstack/setup-localstack).
35
31
36
-
The sample repository has been configured to use the workflow described above.
37
-
For your custom repository, create a new file named `ci-pipeline.yml` in the `.github/workflows` directory.
38
-
This file will contain the CI pipeline that runs on every pull request.
39
-
This pipeline deploys the application to a LocalStack Ephemeral Instance.
32
+
Create a file named `preview-pipeline.yml` in the `.github/workflows` directory of your custom repository.
33
+
This file should contain the CI pipeline that activates on every pull request.
40
34
41
-
The workflow file to create the Application Preview looks like this:
35
+
The pipeline deploys the application to a LocalStack Ephemeral Instance using a `deploy.sh` script or similar for full application deployment.
36
+
A comment containg the preview link is automatically added to a Pull Request when created.
You will also need to configure the `LOCALSTACK_API_KEY` as a repository secret.
80
-
You can find the API key on the [LocalStack Web Application](https://app.localstack.cloud/account/apikeys).
81
-
The `GITHUB_TOKEN` is automatically created by GitHub and you can use it without any additional configuration.
82
-
83
-
### Attach the Preview URL
84
-
85
-
You can now attach the Preview URL to the pull request by using the [`LocalStack/setup-localstack/finish` action](https://github.com/localstack/setup-localstack).
52
+
You must also set the `LOCALSTACK_API_KEY` as a repository secret, available from the [LocalStack Web Application](https://app.localstack.cloud/account/apikeys).
53
+
The `GITHUB_TOKEN` is automatically generated by GitHub and requires no further configuration.
86
54
87
-
The sample repository has been configured to use the workflow described above.
88
-
For your custom repository, create a new file named `ci-finalize.yml` in the `.github/workflows` directory.
89
-
This file contains the CI pipeline that attaches a comment to the pull request with the Preview URL of the deployed application.
55
+
### Stop the Application Preview
90
56
91
-
The workflow file to attach the Preview URL looks like this:
57
+
To stop the Application Preview, you can configure the `state-action` to `stop`.
After a short delay, the workflow will update the pull request with the URL of your preview environment.
120
-
Just click on it to see the changes in real-time.
100
+
## Examples
121
101
122
-
Each time the branch is updated, the same workflow will automatically refresh the preview environment.
102
+
- [Creating ephemeral application previews with LocalStack and GitHub Actions](https://docs.localstack.cloud/tutorials/ephemeral-application-previews/) and the [example repository](https://github.com/localstack-samples/sample-notes-app-dynamodb-lambda-apigateway)
0 commit comments