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 version #374

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
adae97c
update sst
ayinloya Dec 16, 2024
3e42984
fix lint
ayinloya Dec 16, 2024
9c0ec9e
log outpu
ayinloya Dec 16, 2024
5a68b57
log site url
ayinloya Dec 16, 2024
b398c8e
deploy fullstack review app without waiting for embed to complete dep…
ayinloya Dec 16, 2024
f080ad3
fix env name for sst preview url
ayinloya Dec 16, 2024
fe56c70
use project npm for setting and destroying sst deploy
ayinloya Dec 16, 2024
31e6129
add indent
ayinloya Dec 16, 2024
4e9b236
don't check msg
ayinloya Dec 16, 2024
f62a08e
update share preview url
ayinloya Dec 16, 2024
bd897d5
use npx in place of npm run
ayinloya Dec 16, 2024
628f337
Merge branch 'main' into update-sst
ayinloya Dec 16, 2024
cff5268
use npm for sst to ensure package version is used
ayinloya Dec 16, 2024
c43525c
run preview url after build and deploy is complete
ayinloya Dec 16, 2024
5e6da10
fix lint
ayinloya Dec 16, 2024
830eef8
fix npm run sst
ayinloya Dec 16, 2024
8ca6a23
trigger rebuild
ayinloya Dec 16, 2024
8330724
revert change
ayinloya Dec 16, 2024
d2e6a03
add workflow call
ayinloya Dec 16, 2024
a93be2c
remove quotes in workflows
ayinloya Dec 16, 2024
a900b71
add branches ignore
ayinloya Dec 16, 2024
d6fbaa7
add pull request open and ready for review
ayinloya Dec 16, 2024
dd3121f
add logs
ayinloya Dec 16, 2024
63ec3ed
update branch check logic
ayinloya Dec 16, 2024
35db211
call share preview from deploy preview workflow
ayinloya Dec 16, 2024
ecadce6
add full-stack as dependency to share preview url workflow
ayinloya Dec 16, 2024
2374001
add ref name
ayinloya Dec 16, 2024
cfe85ed
update share permission
ayinloya Dec 16, 2024
e0c9b83
allow all permissions for now
ayinloya Dec 16, 2024
dd2ee1b
allow permissions
ayinloya Dec 16, 2024
8b6d6ff
revert permission position
ayinloya Dec 16, 2024
974645e
Merge branch 'main' into update-sst
ayinloya Dec 23, 2024
908e6f4
Merge branch 'main' into update-sst
ayinloya Jan 8, 2025
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
22 changes: 9 additions & 13 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:
types:
- opened
- synchronize
permissions:
id-token: write
contents: read
permissions: write-all
jobs:
test:
uses: ./.github/workflows/test.yml
Expand Down Expand Up @@ -68,7 +66,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 +91,15 @@ 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 }}
share-preview-url:
needs: [full-stack]
uses: ./.github/workflows/share-preview-url.yml
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 }}
36 changes: 28 additions & 8 deletions .github/workflows/share-preview-url.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
name: share-preview-url
on:
pull_request:
types:
- opened
- ready_for_review
workflow_dispatch:
inputs:
ref_name:
description: 'Branch name'
required: true
default: 'main'
workflow_call:
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: set branch name
run: |
if [ -n "${{ github.event.inputs.ref_name }}" ]; then
BRANCH_NAME="${{ github.event.inputs.ref_name }}"
elif [ -n "${{ github.event.workflow_run.head_branch }}" ]; then
BRANCH_NAME="${{ github.event.workflow_run.head_branch }}"
elif [ -n "${GITHUB_HEAD_REF}" ]; then
BRANCH_NAME="${GITHUB_HEAD_REF}"
else
BRANCH_NAME="${{ github.ref_name }}"
fi
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- 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 $BRANCH_NAME --print-logs)
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
Loading
Loading