-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathamplify.yml
More file actions
49 lines (47 loc) · 1.63 KB
/
Copy pathamplify.yml
File metadata and controls
49 lines (47 loc) · 1.63 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
48
49
version: 1
env:
variables:
HUGO_VERSION: "0.157.0"
PRODUCTION_BASEURL: "https://cloud.redhat.com/experts/"
frontend:
phases:
preBuild:
commands:
- git config core.quotepath false
- nvm install 24
- nvm use 24
- node --version
- npm ci
- curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
- mkdir -p "${HOME}/.local/hugo"
- tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
- export PATH="${HOME}/.local/hugo:${PATH}"
- hugo version
build:
commands:
- export PATH="${HOME}/.local/hugo:${PATH}"
- |
set -e
HUGO_ARGS="--gc --minify"
if [ -n "$AWS_PULL_REQUEST_ID" ]; then
DEPLOY_URL="https://pr-${AWS_PULL_REQUEST_ID}.${AWS_APP_ID}.amplifyapp.com"
export HUGO_ENV=staging
HUGO_ARGS="$HUGO_ARGS --buildFuture -b ${DEPLOY_URL}/experts/"
elif [ "$AWS_BRANCH" != "main" ]; then
BRANCH_SLUG=$(echo "$AWS_BRANCH" | sed 's|/|-|g')
DEPLOY_URL="https://${BRANCH_SLUG}.${AWS_APP_ID}.amplifyapp.com"
HUGO_ARGS="$HUGO_ARGS -b ${DEPLOY_URL}/experts/"
else
export HUGO_ENV="${HUGO_ENV:-production}"
HUGO_ARGS="$HUGO_ARGS -b ${PRODUCTION_BASEURL}"
fi
hugo $HUGO_ARGS
npx pagefind --site public/experts
cp public/experts/_redirects public/_redirects
artifacts:
baseDirectory: public
files:
- '**/*'
cache:
paths:
- node_modules/**/*