Skip to content

STUD-346-Distribute-Mint-toggle-should-trigger-on-automatically-after… #118

STUD-346-Distribute-Mint-toggle-should-trigger-on-automatically-after…

STUD-346-Distribute-Mint-toggle-should-trigger-on-automatically-after… #118

name: Deploy NEWM Mobile Wallet to AWS Hosting on merge
on:
push:
branches:
- master
paths:
- .github/workflows/aws-hosting-merge-deploy-newm-mobile-wallet-connector.yml
- apps/mobile-wallet-connector/**
- packages/**
- package-lock.json
workflow_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # required to interact with GitHub's OIDC Token endpoint.
contents: read
steps:
- 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/mobile-wallet-connector/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
sed -i 's|const nextConfig = .*|const nextConfig = { basePath: "/wallet-connect", |' apps/mobile-wallet-connector/next.config.js
APPNAME=mobile-wallet-connector APPID=MobileWalletConnector QUALIFIER=Garage 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_TOOLS_PARTNER_CODE=${{ secrets.DEXHUNTER_TOOLS_PARTNER_CODE }} NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }} npm run --prefix .github/workflows/cdk cdk:deploy deploy -- --require-approval never