Skip to content

Refactor adjustments and tweaks #1428

Refactor adjustments and tweaks

Refactor adjustments and tweaks #1428

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
container:
image: node:lts
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout Codebase
uses: actions/checkout@v4
- name: Use local Yarn version
run: echo "$(pwd)/.yarn/releases" >> $GITHUB_PATH
# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v4
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
- name: Install Dependencies
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
container:
image: node:lts
needs: ['setup']
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout Codebase
uses: actions/checkout@v4
- name: Use local Yarn version
run: echo "$(pwd)/.yarn/releases" >> $GITHUB_PATH
# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v4
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 Dependencies
run: yarn install
- name: Build Packages
run: yarn build --force
- 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
container:
image: node:lts
needs: ['setup', 'build_outline']
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v4
- name: Use local Yarn version
run: echo "$(pwd)/.yarn/releases" >> $GITHUB_PATH
# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v4
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 Dependencies
run: yarn install
- name: Build Packages
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@v4
with:
name: storybook-latest
path: storybook-static/
retention-days: 1