From 29e8d3d133d4039b39aaf487f78b5d4ebe02cf4d Mon Sep 17 00:00:00 2001 From: Andrew Trieu Date: Sun, 24 Nov 2024 15:10:05 +0200 Subject: [PATCH] feat: Refactor Amplify deployment configuration for monorepo structure --- .github/workflows/amplify-deployment.yml | 4 ++-- tasker-client/amplify.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/amplify-deployment.yml b/.github/workflows/amplify-deployment.yml index 837de51..8cbdee2 100644 --- a/.github/workflows/amplify-deployment.yml +++ b/.github/workflows/amplify-deployment.yml @@ -71,11 +71,11 @@ jobs: amplify env set NEXT_PUBLIC_COGNITO_USER_POOL_ID=$NEXT_PUBLIC_COGNITO_USER_POOL_ID amplify env set NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID=$NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID amplify env set S3_PUBLIC_IMAGE_URL=$S3_PUBLIC_IMAGE_URL - amplify env set AMPLIFY_MONOREPO_APP_ROOT=tasker-client - amplify env set AMPLIFY_DIFF_DEPLOY=false - name: Deploy Amplify App run: | + export AMPLIFY_MONOREPO_APP_ROOT=tasker-client + export AMPLIFY_DIFF_DEPLOY=false aws amplify start-deployment \ --app-id ${{ secrets.AWS_AMPLIFY_APP_ID }} \ --branch-name main diff --git a/tasker-client/amplify.yml b/tasker-client/amplify.yml index 7893ca6..c3a3de9 100644 --- a/tasker-client/amplify.yml +++ b/tasker-client/amplify.yml @@ -3,22 +3,23 @@ frontend: phases: preBuild: commands: - - cd tasker-client - npm ci build: commands: - - cd tasker-client - npm run build artifacts: - baseDirectory: tasker-client/.next + baseDirectory: .next files: - "**/*" cache: paths: - - tasker-client/node_modules/**/* + - node_modules/**/* + - .next/cache/**/* + - .npm/**/* env: variables: - # To be populated by GitHub Actions + AMPLIFY_MONOREPO_APP_ROOT: tasker-client + AMPLIFY_DIFF_DEPLOY: false NEXT_PUBLIC_API_BASE_URL: "" NEXT_PUBLIC_COGNITO_USER_POOL_ID: "" NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID: ""