docs-v2/.circleci/config.yml

82 lines
2.7 KiB
YAML
Raw Normal View History

2019-01-18 20:53:09 +00:00
version: 2
jobs:
build:
docker:
- image: cimg/node:20.11.1
2019-01-18 20:53:09 +00:00
environment:
S3DEPLOY_VERSION: "2.11.0"
# From https://github.com/bep/s3deploy/releases
S3DEPLOY_VERSION_HASH: "d3566a6a56735ea5710cf22c35f8f411164e6efc22ded98743a1d7a5a21c740e"
2019-01-18 20:53:09 +00:00
steps:
- checkout
- restore_cache:
keys:
- install-{{ .Environment.CACHE_VERSION }}-{{ checksum ".circleci/config.yml" }}
- install-{{ .Environment.CACHE_VERSION }}-
2019-01-18 20:53:09 +00:00
- run:
name: Make bin folder
command: mkdir -p $HOME/bin
- run:
name: Install s3deploy
command: ./deploy/ci-install-s3deploy.sh
2020-04-22 17:45:47 +00:00
- run:
2020-04-22 18:18:44 +00:00
name: Install NodeJS dependencies
Install dependencies as project dependencies from NPM repo (#2476) * Added hugo-extended, postcss, postcss-cli, and autoprefixer as devDependencies. Run npm install or yarn install. (#2474) * Replaced global hugo and yarn installs with project-level yarn install. * Replaced npm package.lock with yarn.lock (#2474). * enhancement: update README with instructions for installing NODE.JS dependencies. (#2474) * updated api doc generator script to use npx * Update README.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update README.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update README.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update README.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update README.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update package.json Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * fix: indentation. (#2476) * update: Added separate dependencies list for api-docs. - Moved redoc-cli to a separate package.json in api-docs. Excluded api-docs/node_modules from generate-api-docs.sh. - Updated redoc-cli argument sequence to agree with their docs. - Updated READMEs. - Fixed typos. * update: add api-docs > yarn install to .circleci * Added language and consistency to code block. Specify where to run the command. Co-authored-by: Scott Anderson <scott@influxdata.com> Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
2021-05-24 17:11:01 +00:00
command: yarn install
- run:
name: Install API documentation dependencies
command: cd api-docs && yarn install
- run:
name: Generate API documentation
command: cd api-docs && bash generate-api-docs.sh
- run:
name: Inject Flux stdlib frontmatter
command: node ./flux-build-scripts/inject-flux-stdlib-frontmatter.js
- run:
name: Update Flux/InfluxDB versions
command: node ./flux-build-scripts/update-flux-versions.js
2019-01-18 20:53:09 +00:00
- save_cache:
key: install-{{ .Environment.CACHE_VERSION }}-{{ checksum ".circleci/config.yml" }}
2019-01-18 20:53:09 +00:00
paths:
- /home/circleci/bin
- run:
name: Hugo Build
command: npx hugo --logLevel info --minify --destination workspace/public
2019-01-18 20:53:09 +00:00
- persist_to_workspace:
root: workspace
paths:
- public
deploy:
docker:
- image: cimg/go:1.22.1
2019-01-18 20:53:09 +00:00
steps:
- checkout
- restore_cache:
keys:
- install-{{ .Environment.CACHE_VERSION }}-{{ checksum ".circleci/config.yml" }}
- install-{{ .Environment.CACHE_VERSION }}-
2019-01-18 20:53:09 +00:00
- attach_workspace:
at: workspace
- run:
name: Deploy to S3
command: $HOME/bin/s3deploy -source=workspace/public/ -bucket=$BUCKET -region=$REGION -distribution-id=$CF_DISTRIBUTION_ID
- run:
name: Post in Slack
2019-02-08 21:13:13 +00:00
command: >
2020-09-02 23:55:33 +00:00
export COMMIT_INFO="$(git log -1 --format='%n>>>%s%n%b%n_<https://github.com/influxdata/docs-v2/commit/%H|Commit %h> - by %an_')"; curl -X POST --data-urlencode "payload={\"username\": \"Doc the Docs Bot\", \"text\": \"The docs successfully deployed! :greeny_peeny:\n\n $COMMIT_INFO\", \"icon_emoji\": \":doc_green:\"}" $SLACK_DOCS_WEBHOOK_URL
when: on_success
2019-01-18 20:53:09 +00:00
workflows:
version: 2
build:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only:
2019-01-18 21:05:06 +00:00
- master