-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,23 @@ jobs: | |
- name: Build packages and storybook | ||
run: yarn build | ||
|
||
# Deploy to staging Github Pages using `gh-pages` package | ||
- name: Deploy | ||
# move storybook-static files to temp folder before checking out to `gh-pages` branch | ||
- name: Move storybook to build folder | ||
run: | | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
npx gh-pages -d packages/core/storybook-static -u "github-actions-bot <[email protected]>" --dest staging --message "chore(deploy): deploy to gh-pages staging" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
mkdir -p builds | ||
mv packages/core/storybook-static/* builds | ||
# remove old files and push storybook-static files to staging folder | ||
- name: Deploy production environment to Github Pages | ||
run: | | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git config user.name $GITHUB_ACTOR | ||
git fetch origin gh-pages | ||
git checkout -b gh-pages origin/gh-pages | ||
git update-ref -d refs/remotes/origin/gh-pages | ||
git pull origin gh-pages | ||
rm -rf staging | ||
mkdir -p staging | ||
mv builds/* staging | ||
git add staging | ||
git commit -m "chore(deploy): deploy staging storybook to GitHub Pages" | ||
git push origin gh-pages --force |