-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathamplify.yml
More file actions
47 lines (47 loc) · 1.79 KB
/
amplify.yml
File metadata and controls
47 lines (47 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
version: 1
frontend:
phases:
preBuild:
commands:
- NODE_VERSION=$(cat .tool-versions | grep '^nodejs' | sed 's/nodejs //')
- echo "Using Node.js version $NODE_VERSION"
- nvm install "$NODE_VERSION"
- node -v
# Set the NEXTAUTH_URL to the preview URL if the branch is not main or staging
# The preview URL is in the format https://<branch-name>.<app-id>.amplifyapp.com
- |
if [[ "${AWS_BRANCH}" != "main" && "${AWS_BRANCH}" != "staging" ]]; then
SUBDOMAIN="$(echo $AWS_BRANCH | sed 's/[^a-zA-Z0-9-]/-/g')"
PREVIEW_URL="https://${SUBDOMAIN}.${AWS_APP_ID}.amplifyapp.com";
NEXTAUTH_URL=$PREVIEW_URL;
echo "PREVIEW_URL=$PREVIEW_URL" >> .env;
fi
- echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
# Download git-lfs and make it executable
- curl -L -o git-lfs.tar.gz https://github.com/git-lfs/git-lfs/releases/download/v3.6.1/git-lfs-linux-amd64-v3.6.1.tar.gz
- mkdir -p ./bin
- tar -xvzf git-lfs.tar.gz
- mv git-lfs-3.6.1/git-lfs ./bin/
- chmod +x ./bin/git-lfs
# Install git-lfs and pull down the files
- export PATH=$PATH:$(pwd)/bin && git-lfs install
- export PATH=$PATH:$(pwd)/bin && git-lfs pull
# Install npm dependencies
- yarn config set nodeLinker node-modules
- yarn -v
- yarn
- yarn disable-telemetry
# Build graphql files
- yarn gql
# Extract translations
- timeout 1m yarn crowdin:download || echo "yarn crowdin:download timed out after 1 minute or failed with an error"
build:
commands:
- yarn build:amplify
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- '.next/cache/**/*'