Skip to content

Outline Fall/Winter Update!! #1339

Outline Fall/Winter Update!!

Outline Fall/Winter Update!! #1339

Workflow file for this run

# Build Workflows for Outline.js
name: Outline Core Build
# Controls when the action will run. Triggers the workflow on push or pull request
on:
# Which branches to test on push/merge.
push:
branches:
- release
- main
- next
- dev
- alpha
- beta
- rc
# Which branches to test on pull request.
pull_request:
branches:
- release
- main
- next
- dev
- alpha
- beta
- rc
- /^issue/
- /^task/
- /^feature/
- /^bug/
- /^test/
# The jobs for the build workflow.
jobs:
# Basic setup job to prepare codebase.
setup:
name: Install & Lint Codebase
runs-on: ubuntu-latest
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout Codebase
uses: actions/checkout@v3
# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: |
**/yarn.lock
**/node_modules
**/dist
**/.turbo
# The registry to use by default for package publishing.
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@phase2'
- name: Initialize .npmrc
run: cp $NPM_CONFIG_USERCONFIG .npmrc
# # @see https://github.com/marketplace/actions/cache
# # node_modules caching is validated by always running yarn install.
# # Turborepo cache lives inside node_modules/.cache/turbo
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# - name: Setup Cache
# id: cache-yarn
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-node-yarn-18-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
# restore-keys:
# ${{ runner.os }}-node-yarn-18-${{ env.cache-name }}-
# ${{ runner.os }}-node-yarn-${{ env.cache-name }}-
# ${{ runner.os }}-node-yarn-
- name: Install
run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_PACKAGES }}
- name: Run eslint
run: yarn lint:eslint
- name: Run prettier
run: yarn lint:prettier
# Job to run build, and basic assurances the codebase is ready for additional processing.
build_outline:
name: Build Outline Codebase
runs-on: ubuntu-latest
needs: ['setup']
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout Codebase
uses: actions/checkout@v3
# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: |
**/yarn.lock
**/node_modules
**/dist
**/.turbo
# The registry to use by default for package publishing.
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@phase2'
- name: Install
run: yarn install
- name: Build Turborepo Packages
run: yarn build
- name: Build Storybook
run: yarn storybook:build
# Basic setup job to prepare codebase.
deploy-github-pages:
name: "Publish: GitHub Pages"
if: github.ref == 'refs/heads/next'
runs-on: ubuntu-latest
needs: ['setup', 'build_outline']
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v3
# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: |
**/yarn.lock
**/node_modules
**/dist
**/.turbo
# The registry to use by default for package publishing.
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@phase2'
- name: Install
run: yarn install
- name: Build Outline
run: yarn build
- name: Build Storybook
run: yarn storybook:build
- name: Check GitHub Pages status
uses: crazy-max/ghaction-github-status@v3
with:
pages_threshold: major_outage
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: storybook-static
commit_message: 'chore(deploy): Storybook'
keep_history: false
jekyll: false
fqdn: outline.phase2tech.com
env:
GITHUB_TOKEN: ${{ secrets.NPM_GITHUB_PACKAGES }}
# @see https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Storybook artifact
uses: actions/upload-artifact@v3
with:
name: storybook-latest
path: storybook-static/
retention-days: 1