-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add previews * Add preview app * link files * Fix lint * Downgrade sst due to this issue https://github.com/sst/ion/issues/774 * Update readme * Add destroy workflow when pr is closed * Fix destroy deployed preview app workflow name * Add script to retrieve the app url * Set the right branch name for deployment Share preview app url as comment on PR * Deploy preview regardless of outcome of other steps * Sanitize branch name * Fix sst url after deploy * fix share preview url * use $GITHUB_HEAD_REF to get branch name when sharing preivew * Support deployment when pr is reopened * use sanitized branch name for preview url sharing * Remove pr reopened from workflow * resolve package-lock * enh: full-stack preview app enhancements (#317) * refactor: change `SS_STAGE` to `SST_STAGE` * deps: use latest stable release of sst sst v3 is now a stable release. this removes the need for the go binary install step. npm wins, yet again * fix: fix lint, prettier issues * refactor: remove redundant `default_app` directory --------- Co-authored-by: Barnabas A Nsoh <[email protected]> * Fix lint * add npm to run deploy preview * add sst script --------- Co-authored-by: tams sokari <[email protected]>
- Loading branch information
1 parent
980387b
commit c6950bb
Showing
23 changed files
with
15,043 additions
and
104 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
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,43 @@ | ||
name: destroy-preview | ||
on: | ||
workflow_call: | ||
pull_request: | ||
types: | ||
- closed | ||
permissions: | ||
id-token: write | ||
contents: read | ||
jobs: | ||
full-stack: | ||
defaults: | ||
run: | ||
working-directory: ./previews | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v4 | ||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: install sst | ||
run: | | ||
curl -fsSL https://ion.sst.dev/install | VERSION=0.1.51 bash | ||
- name: set sst stage | ||
id: get_branch_name | ||
run: | | ||
BRANCH_NAME=${{ github.event.pull_request.head.ref }} | ||
SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9]/-/g') | ||
echo "SS_STAGE=$SANITIZED_BRANCH_NAME" >> $GITHUB_OUTPUT | ||
- name: install dependencies | ||
run: npm install | ||
- name: configure sst secrets | ||
run: | | ||
sst secret set PartnerId ${{ secrets.PREVIEW_PARTNER_ID }} --stage=${{ steps.get_branch_name.outputs.SS_STAGE }} && | ||
sst secret set CallbackUrl ${{ secrets.PREVIEW_CALLBACK_URL }} --stage=${{ steps.get_branch_name.outputs.SS_STAGE }} && | ||
sst secret set SmileIdApiKey ${{ secrets.PREVIEW_SMILEID_API_KEY }} --stage=${{ steps.get_branch_name.outputs.SS_STAGE }} && | ||
sst secret set SmileIdEnvironment ${{ secrets.PREVIEW_SMILEID_ENVIRONMENT }} --stage=${{ steps.get_branch_name.outputs.SS_STAGE }} | ||
- name: remove sst app | ||
run: | | ||
sst remove --stage=${{ steps.get_branch_name.outputs.SS_STAGE }} |
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
Oops, something went wrong.