forked from CumulusNetworks/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
amplify.yml
37 lines (37 loc) · 2.24 KB
/
amplify.yml
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
version: 1.0
frontend:
phases:
preBuild:
commands:
- echo Installing Hugo ...
- wget -q https://github.com/gohugoio/hugo/releases/download/v0.81.0/hugo_extended_0.81.0_Linux-64bit.tar.gz
- tar -xf hugo_extended_0.81.0_Linux-64bit.tar.gz hugo
- mv hugo /usr/bin/hugo
- rm -rf hugo_extended_0.81.0_Linux-64bit.tar.gz
- echo Successfully installed Hugo
build:
commands:
# Embed the git commit ID into the PDF for future troubleshooting
#- sed -i "s/COMMIT_INFO/$AWS_COMMIT_ID/g" themes/netDocs/layouts/partials/pdf-head.html
# Add the Google API key at build time
- sed -i "s/SEARCH_KEY/$HUGO_GOOGLE_API_KEY/g" themes/netDocs/layouts/search/search.html
#- echo Building PDFs...
# Install docraptor and requests libraries
#- if [ "${AWS_BRANCH}" = "master" ] && "${CUMULUS}"; then pip3 install --upgrade docraptor requests ; fi
# Tell docraptor to build PDFs and XLS and wait for a response
# This is specifically the stage branch because we need to generate the files from what's already published,
# Meaning we can't generate it from the results of /this/ build.
# This only runs in the master branch, and assumes that stage was merged into master to trigger the build
# build_pdfs.py <DOCRAPTOR_API_KEY> <BASE_URL> <HTTP_AUTH_NAME> <HTTP_AUTH_PASS>
# If PDF/XLS generation is failing, comment out the following line to build the site.
#- if [ "${AWS_BRANCH}" = "master" ] && "${CUMULUS}"; then python3 utils/build_pdf_xls.py $DOCRAPTOR_KEY https://stage.d1w082ag5m7upl.amplifyapp.com/ $USERNAME $PASSWORD ; fi
- echo Building docs ...
# Don't minify in non-prod branches to simplify troubleshooting
- if [ "${AWS_BRANCH}" != "master" ]; then hugo -D --baseURL $BASEURL -d public/networking-ethernet-software/ ; fi
- if [ "${AWS_BRANCH}" = "master" ]; then hugo --minify --baseURL $BASEURL ; fi
- if [ "${AWS_BRANCH}" != "master" ]; then echo "<html><head></head><body><a href='networking-ethernet-software/''>click here</a></body></html>" > public/index.html ; fi
- echo Successfully built docs
artifacts:
files:
- '**/*'
baseDirectory: public