Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate deployments to vercel #363

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,51 +88,3 @@ jobs:
exitOnceUploaded: true
autoAcceptChanges: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

deploy-docs:
name: 'Deploy Latest documentation'
needs: publish
if: needs.publish.outputs.published == 'true'
runs-on: ubuntu-latest
environment:
name: Docs Production
url: ${{ steps.publish_docs.outputs.NETLIFY_PREVIEW_URL }}
env:
NODE_OPTIONS: --max-old-space-size=4096
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/cache@v2
name: Download storybook cache
with:
path: |
**/node_modules/.cache
key: ${{ runner.os }}-storybook-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-storybook

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build Docs
run: pnpm build-docs --quiet

- name: Deploy docs to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: ./storybook-docs
65 changes: 0 additions & 65 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,68 +163,3 @@ jobs:
repo: context.repo,
prNumber: context.payload.pull_request.number
})

deploy-docs:
name: 'Prepare Docs for the Review'
runs-on: ubuntu-latest
environment:
name: Docs staging
url: ${{ steps.publish_docs.outputs.preview-url }}
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/cache@v2
name: Download storybook cache
with:
path: |
**/node_modules/.cache
key: ${{ runner.os }}-storybook-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-storybook

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build Docs
run: pnpm build-docs --quiet

- name: Deploy docs to Netlify
id: publish_docs
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
draft: true
build-dir: ./storybook-docs
comment-on-commit: true

- name: Comment PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const setMessage = require('${{ github.workspace }}/scripts/ci/set-message')

await setMessage({
header: "## 🏗 Docs are successfully deployed!",
body: `
👀 Preview: ${{ steps.publish_docs.outputs.preview-url }}
`,
github,
repo: context.repo,
prNumber: context.payload.pull_request.number
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"storybook": "^7.0.17",
"tiny-invariant": "^1.3.1",
"valid-url": "^1.0.9",
"vercel-action@v20": "link:amondnet/vercel-action@v20",
"vite": "^4.3.5"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading