Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Deploy Storybook to GitHub pages (#550)

sarayourfrienda70349fa29c1
diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml
new file mode 100644
index 000000000..a1f957ba3
--- /dev/null
+++ b/.github/workflows/gh-pages.yaml
@@ -0,0 +1,54 @@
+name: Storybook GitHub Pages
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ if: ${{ github.repository == 'WordPress/openverse-frontend' }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ # setup node.js environment and npm
+ - name: Setup Node environment
+ uses: actions/setup-node@v2
+ with:
+ node-version: '16.x'
+
+ - name: Cache dependencies
+ uses: actions/cache@v2
+ with:
+ path: ~/.pnpm-store
+ key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-
+
+ - name: Setup pnpm
+ uses: pnpm/[email protected]
+ with:
+ version: 6.24.0
+ # Set this to false because we want to be able to skip installation if there is a cache hit in the next step
+ run_install: false
+
+ # install dependencies only if the cache is not present
+ - name: Install dependencies
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: pnpm install --frozen-lockfile
+
+ - name: Fetch translation files
+ run: pnpm i18n:get-translations
+
+ - name: Build Storybook
+ run: pnpm nuxt storybook build
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./storybook-static
+ force_orphan: true
diff --git a/README.md b/README.md
index 6764fdb88..083358b9a 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
This repository is the frontend UI for accessing and exploring the openly-licensed content provided by the [Openverse API](https://github.com/wordpress/openverse-api).
-The application is live at its previous home: [search.creativecommons.org](https://search.creativecommons.org/).
+You can view [the application](https://wordpress.org/openverse) live on WordPress.org. You can also view [the production Storybook](https://wordpress.github.io/openverse-frontend)
## Technology