-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |