Skip to content

Commit 8e02167

Browse files
authored
feat(ci): add preview pipelines (#18)
* feat(ci): add preview pipelines * fix(ci): add permission for PR commenting * fix(ci): add dependency install * ci(preview_create): remove Open URL message
1 parent 93e2ea0 commit 8e02167

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/preview_create.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create PR Preview
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 15
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.9
18+
id: setup-python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.9
22+
23+
- name: Install dependencies
24+
run: |
25+
pip install awscli-local
26+
27+
- name: Deploy Preview
28+
uses: LocalStack/setup-localstack/preview@main
29+
env:
30+
AWS_DEFAULT_REGION: us-east-1
31+
AWS_REGION: us-east-1
32+
AWS_ACCESS_KEY_ID: test
33+
AWS_SECRET_ACCESS_KEY: test
34+
with:
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
localstack-api-key: ${{ secrets.LOCALSTACK_API_KEY }}
37+
preview-cmd: |
38+
# Add your custom deployment commands here.
39+
# Below is an example for the Image resizer application.
40+
bin/deploy.sh
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Finalize PR Preview
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Create PR Preview"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- name: Finalize PR comment
16+
uses: LocalStack/setup-localstack/finish@main
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
include-preview: true

0 commit comments

Comments
 (0)