Skip to content

Commit

Permalink
feat(ci): add preview pipelines (#18)
Browse files Browse the repository at this point in the history
* feat(ci): add preview pipelines

* fix(ci): add permission for PR commenting

* fix(ci): add dependency install

* ci(preview_create): remove Open URL message
  • Loading branch information
lakkeger authored Feb 19, 2024
1 parent 93e2ea0 commit 8e02167
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/preview_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Create PR Preview

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.9
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install awscli-local
- name: Deploy Preview
uses: LocalStack/setup-localstack/preview@main
env:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
localstack-api-key: ${{ secrets.LOCALSTACK_API_KEY }}
preview-cmd: |
# Add your custom deployment commands here.
# Below is an example for the Image resizer application.
bin/deploy.sh
19 changes: 19 additions & 0 deletions .github/workflows/preview_finalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Finalize PR Preview

on:
workflow_run:
workflows: ["Create PR Preview"]
types:
- completed

jobs:
test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Finalize PR comment
uses: LocalStack/setup-localstack/finish@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
include-preview: true

0 comments on commit 8e02167

Please sign in to comment.