Skip to content

Oops

Oops #339

# Generated by cdkactions. Do not modify
# Generated as part of the 'kraken' stack.
name: Publish kraken
on:
push:
paths:
- cdk/kraken/**
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: "**/node_modules"
key: v0-${{ hashFiles('cdk/kraken/yarn.lock') }}
- name: Install Dependencies
run: |-
cd cdk/kraken
yarn install --frozen-lockfile
- name: Test
run: |-
cd cdk/kraken
yarn test
- name: Upload Code Coverage
run: |-
ROOT=$(pwd)
cd cdk/kraken
yarn run codecov -p $ROOT -F kraken
- name: Install jq
run: |-
curl -sSLo /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x /usr/bin/jq
- name: Check if version is already published to npm
id: version_check
run: |-
cd cdk/kraken
PACKAGE=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
NEW_VERSION=$(yarn info $PACKAGE versions --json | jq ".data | any(. == \"$VERSION\") | not")
echo "::set-output name=NEW_VERSION::$NEW_VERSION"
- name: Publish to npm
run: |-
cd cdk/kraken
yarn compile
yarn package
mv dist/js/*.tgz dist/js/kraken.tgz
yarn publish --non-interactive --access public dist/js/kraken.tgz
if: github.ref == 'refs/heads/master' && steps.version_check.outputs.NEW_VERSION == 'true'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Build docs
run: |-
cd cdk/kraken
yarn docgen
- name: Publish docs
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.BOT_GITHUB_PAT }}
external_repository: pennlabs/kraken-docs
cname: kraken.pennlabs.org
publish_branch: master
publish_dir: cdk/kraken/docs
user_name: github-actions
user_email: github-actions[bot]@users.noreply.github.com
container:
image: node:14