Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Deploy Preview
uses: LocalStack/setup-localstack@v0.2.0
uses: LocalStack/setup-localstack@fix_finish_comment
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
with:
Expand All @@ -23,24 +23,18 @@ jobs:
state-action: start
include-preview: 'true'
install-awslocal: 'true'
skip-ephemeral-stop: 'false'
# Multi line commands are folding for some reason, so we enforce new lines
# For more predictable usage, use script files
preview-cmd: |
npm install -g aws-cdk-local aws-cdk;
make build;
make bootstrap;
make deploy;
make prepare-frontend-local;
make build-frontend;
make bootstrap-frontend;
make deploy-frontend;
distributionId=$(awslocal cloudfront list-distributions | jq -r '.DistributionList.Items[0].Id');
echo \"PREVIEW_URL=$AWS_ENDPOINT_URL/cloudfront/$distributionId/\" >> $GITHUB_ENV;
npm install -g aws-cdk-local aws-cdk
make build
make bootstrap
make deploy
make prepare-frontend-local
make build-frontend
make bootstrap-frontend
make deploy-frontend
distributionId=$(awslocal cloudfront list-distributions | jq -r '.DistributionList.Items[0].Id')
echo "PREVIEW_URL=$AWS_ENDPOINT_URL/cloudfront/$distributionId/" >> $GITHUB_ENV


- name: Finalize PR comment
uses: LocalStack/setup-localstack/finish@v0.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
include-preview: true
preview-url: ${{ env.PREVIEW_URL }}