Skip to content

Commit

Permalink
Merge pull request #132 from US-CBP/feature/minor-updates-20210329
Browse files Browse the repository at this point in the history
Feature/minor updates 20210329
  • Loading branch information
dgibson666 authored Apr 11, 2024
2 parents 2f2921e + 75374de commit 38b3f7b
Show file tree
Hide file tree
Showing 19 changed files with 19,515 additions and 556 deletions.
68 changes: 21 additions & 47 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,37 @@
name: Deploy Github Pages
run-name: ${{ github.actor }} is deploying the design system to Github Pages
on:
workflow_dispatch:
# Workflow name
name: Build and Publish Storybook to GitHub Pages
run-name: ${{ github.actor }} is deploying the CBP Design System documentation packages to Github Pages

# Event for the workflow to run on
on:
push:
tags:
- '*'
branches:
- 'develop'

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

jobs:
build:
name: build static content
timeout-minutes: 15
# List of jobs
jobs:
deploy:
runs-on: ubuntu-latest

# Job steps
steps:
# Manual Checkout
- uses: actions/checkout@v3

# Set up Node
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: npm
- run: npm ci # runs clean-install
- run: npm run build-pages # build all static sites in all packages

- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
tar \
--dereference --hard-dereference \
--directory ".public" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
node-version: '18.x'

- uses: actions/upload-artifact@v3
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
- uses: bitovi/[email protected]
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: "1"
if-no-files-found: error

deploy:
needs: build

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
install_command: npm ci # default: npm ci
build_command: npm run build-pages # default: npm run build-storybook
path: .public # default: dist/storybook
checkout: false # default: true
Loading

0 comments on commit 38b3f7b

Please sign in to comment.