Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update sst #373

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
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
15 changes: 5 additions & 10 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
run: |
aws s3 sync --follow-symlinks --delete dist s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.DEST_DIR_EMBED }}
full-stack:
needs: [embed]
if: always()
defaults:
run:
Expand All @@ -94,16 +93,12 @@ jobs:
run: npm run build
- name: configure sst secrets
run: |
npm run sst secret set PartnerId ${{ secrets.PREVIEW_PARTNER_ID }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
npm run sst secret set CallbackUrl ${{ secrets.PREVIEW_CALLBACK_URL }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
npm run sst secret set SmileIdApiKey ${{ secrets.PREVIEW_SMILEID_API_KEY }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
npm run sst secret set SmileIdEnvironment ${{ secrets.PREVIEW_SMILEID_ENVIRONMENT }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }}
npm run sst secret set PartnerId ${{ secrets.PREVIEW_PARTNER_ID }} -- --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
npm run sst secret set CallbackUrl ${{ secrets.PREVIEW_CALLBACK_URL }} -- --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
npm run sst secret set SmileIdApiKey ${{ secrets.PREVIEW_SMILEID_API_KEY }} -- --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
npm run sst secret set SmileIdEnvironment ${{ secrets.PREVIEW_SMILEID_ENVIRONMENT }} -- --stage ${{ steps.get_branch_name.outputs.SST_STAGE }}
- name: deploy sst app
if: github.event.pull_request.merged != true
id: deploy_sst_app
run: |
npm run sst deploy --stage=${{ steps.get_branch_name.outputs.SST_STAGE }}
- name: remove sst app
if: github.event.pull_request.merged == true
run: |
npm run sst remove --stage=${{ steps.get_branch_name.outputs.SST_STAGE }}
npm run sst deploy -- --stage ${{ steps.get_branch_name.outputs.SST_STAGE }}
10 changes: 2 additions & 8 deletions .github/workflows/destroy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
- name: install sst
run: |
curl -fsSL https://ion.sst.dev/install | VERSION=0.1.51 bash
curl -fsSL https://ion.sst.dev/install | VERSION=3.4.5 bash
- name: set sst stage
id: get_branch_name
run: |
Expand All @@ -32,12 +32,6 @@ jobs:
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 }}
npm run sst remove -- --stage ${{ steps.get_branch_name.outputs.SS_STAGE }}
21 changes: 14 additions & 7 deletions .github/workflows/share-preview-url.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
name: share-preview-url
on:
pull_request:
workflow_dispatch:
workflow_run:
workflows: ['deploy-preview']
types:
- opened
- ready_for_review
- completed
branches-ignore: ['main']
jobs:
comment-on-pr:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set node version
uses: actions/setup-node@v4
- name: install dependencies
run: npm ci
- 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
continue-on-error: true
run: |
curl -fsSL https://ion.sst.dev/install | VERSION=0.1.51 bash
curl -fsSL https://ion.sst.dev/install | VERSION=3.4.5 bash
- name: retrieve sst app url
continue-on-error: true
id: get_app_url
working-directory: ./previews
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
APP_URL=$(npm run sst shell node get_app_url.js -- --stage $GITHUB_HEAD_REF)
echo "PREVIEW_APP_URL=$APP_URL" >> $GITHUB_OUTPUT
- name: get dest dir for web smart-camera-web
id: get_dest_dir_smart_camera_web
working-directory: ./packages/smart-camera-web
Expand Down
4 changes: 2 additions & 2 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading