Woooo #325
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by cdkactions. Do not modify | |
# Generated as part of the 'kittyhawk' stack. | |
name: Publish kittyhawk | |
on: | |
push: | |
paths: | |
- cdk/kittyhawk/** | |
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/kittyhawk/yarn.lock') }} | |
- name: Install Dependencies | |
run: |- | |
cd cdk/kittyhawk | |
yarn install --frozen-lockfile | |
- name: Test | |
run: |- | |
cd cdk/kittyhawk | |
yarn test | |
- name: Upload Code Coverage | |
run: |- | |
ROOT=$(pwd) | |
cd cdk/kittyhawk | |
yarn run codecov -p $ROOT -F kittyhawk | |
- 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/kittyhawk | |
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/kittyhawk | |
yarn compile | |
yarn package | |
mv dist/js/*.tgz dist/js/kittyhawk.tgz | |
yarn publish --non-interactive --access public dist/js/kittyhawk.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/kittyhawk | |
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/kittyhawk-docs | |
cname: kittyhawk.pennlabs.org | |
publish_branch: master | |
publish_dir: cdk/kittyhawk/docs | |
user_name: github-actions | |
user_email: github-actions[bot]@users.noreply.github.com | |
container: | |
image: node:14 |