Skip to content

Commit

Permalink
site: Migrate preview sites from surge to ghpages (#1644)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltaranto authored Nov 6, 2024
1 parent 49a6818 commit fe9bec5
Show file tree
Hide file tree
Showing 13 changed files with 151 additions and 427 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,21 @@ jobs:

- name: Build
run: pnpm build:site

- name: Deploy to surge
run: pnpm surge -p ./site/dist -d braid-design-system--${GITHUB_SHA}.surge.sh
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
BASE_NAME: /braid-design-system/preview/${{ github.sha }}
BRANCH_NAME: ${{ github.ref_name }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}

- name: Deploy preview site
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # 4.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: ./site/dist
target-folder: preview/${{ github.sha }}
commit-message: Preview of `${{ github.ref_name }}`

- name: Update PR status
run: pnpm post-commit-status
env:
BASE_NAME: /braid-design-system/preview/${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
IS_GITHUB_PAGES: true

- name: Build site
run: pnpm build:site
env:
BASE_NAME: /braid-design-system

- name: Deploy site
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # 4.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: ./site/dist
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"generate:component-docs": "nx run site:generate:component-docs",
"deploy": "node scripts/deploy.js",
"post-commit-status": "node scripts/postCommitStatus.js",
"release": "pnpm prepare-publish && changeset publish && pnpm build:site && pnpm run deploy",
"release": "pnpm prepare-publish && changeset publish",
"prepare-publish": "pnpm build && pnpm build:docs-ui && tsx scripts/copyReadme.cts",
"version": "changeset version && tsx scripts/versionComponentUpdates.cts && pnpm install --lockfile-only",
"changeset": "EDITOR=scripts/writeBraidFrontMatter.js ./node_modules/.bin/changeset add --open"
Expand Down Expand Up @@ -70,7 +70,6 @@
"eslint-config-seek": "^13.0.0",
"fast-glob": "^3.2.12",
"fs-extra": "^10.1.0",
"gh-pages": "^4.0.0",
"ignore-sync": "^7.0.0",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
Expand All @@ -80,7 +79,6 @@
"prettier": "^2.8.8",
"renovate-config-seek": "0.4.0",
"skott": "^0.32.1",
"surge": "^0.23.1",
"tsx": "^4.7.0",
"typescript": "~5.5.4"
},
Expand Down
Loading

0 comments on commit fe9bec5

Please sign in to comment.