Skip to content

Commit

Permalink
try separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki committed Jun 28, 2024
1 parent 197f341 commit c2a4b77
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ jobs:
- run: PUBLIC_URL=/mit-open yarn build-storybook --output-dir ../github-pages/build/storybook
working-directory: frontends

- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5

- name: Upload artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/publish_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: "^20"
cache: yarn
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn install

- name: Build Storybook
run: yarn workspace mit-open build-storybook

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./frontends/mit-open/storybook-static

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

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

# 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@v4 # or specific "vX.X.X" version tag for this action
1 change: 0 additions & 1 deletion frontends/mit-open/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const config = {
docs: {
autodocs: "tag",
},
staticDirs: ["../build"],
env: (config: any) => ({
...config,
PUBLIC_URL: process.env.PUBLIC_URL || "",
Expand Down
2 changes: 1 addition & 1 deletion frontends/mit-open/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": "webpack --config webpack.config.js --bail",
"build-exports": "webpack --config webpack.exports.js --bail",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build --output-dir build/storybook"
"build-storybook": "storybook build"
},
"devDependencies": {
"@emotion/react": "^11.11.1",
Expand Down

0 comments on commit c2a4b77

Please sign in to comment.