Updates wallet connector package version #264
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
name: Deploy NEWM Marketplace to AWS Hosting on PR | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/aws-hosting-pull-request-newm-marketplace.yml | |
- apps/marketplace/** | |
- packages/** | |
- package-lock.json | |
jobs: | |
build_and_preview: | |
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}" | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # required to interact with GitHub's OIDC Token endpoint. | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.AWS_GITHUB_DEPLOY_ROLE_ARN_GARAGE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Lambda-ify | |
run: echo "COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.7.1 /lambda-adapter /opt/extensions/lambda-adapter" >> apps/marketplace/Dockerfile | |
- name: Install AWS CDK | |
run: npm install -g aws-cdk | |
- name: Set outputs | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Deploy to Lambda Function | |
run: | | |
npm install --prefix .github/workflows/cdk | |
APPNAME=marketplace QUALIFIER=${{ github.event.pull_request.number }} NEXT_PUBLIC_ENV=staging NEXT_PUBLIC_RECAPTCHA_SITE_KEY_STAGING=${{ secrets.RECAPTCHA_SITE_KEY_STAGING }} NEXT_PUBLIC_LAUNCHDARKLY_CLIENT_ID_STAGING=${{ secrets.LAUNCHDARKLY_CLIENT_ID_STAGING }} NEXT_PUBLIC_DEXHUNTER_MARKETPLACE_PARTNER_CODE=${{ secrets.DEXHUNTER_MARKETPLACE_PARTNER_CODE }} NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }} NEXT_PUBLIC_GA_MARKETPLACE_ID=${{ secrets.GA_MARKETPLACE_ID }} npm run --prefix .github/workflows/cdk cdk:preview deploy -- --require-approval never | |
- name: Get preview url | |
id: previewurl | |
run: echo "previewurl=$(aws cloudformation describe-stacks --stack-name marketplace-${{ github.event.pull_request.number }} --query 'Stacks[0].Outputs[0].OutputValue' --output text)" >> $GITHUB_OUTPUT | |
- name: Url to PR comment | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message: | | |
Visit the marketplace preview URL for this PR (updated for commit ${{ steps.vars.outputs.sha_short }}): | |
:rocket: ${{ steps.previewurl.outputs.previewurl }} | |
allow-repeats: true |