Skip to content

Commit

Permalink
Fix pushing of built docs on release
Browse files Browse the repository at this point in the history
  • Loading branch information
kevhender committed Feb 27, 2020
1 parent fe122e6 commit 7b930ba
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,36 @@ jobs:
echo "::set-env name=VERSION::${VERSION}"
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: react-storefront-community/react-storefront-community.github.io
token: ${{ secrets.MOOVWEB_GITHUB_TOKEN }}
path: pages-repo
- uses: actions/checkout@v2
with:
repository: moovweb/react-storefront-docs
token: ${{ secrets.MOOVWEB_GITHUB_TOKEN }}
path: docs-repo
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Push API docs to GitHub Pages
run: |
npm ci
npm run docs
npm run build-storybook
VERSION=${{ env.VERSION }}
cd ..
git clone https://react-storefront-community:${{ secrets.GITHUB_TOKEN }}@github.com/react-storefront-community/react-storefront-community.github.io.git
git clone https://${{ secrets.MOOVWEB_GITHUB_USER }}:${{ secrets.MOOVWEB_GITHUB_TOKEN }}@github.com/moovweb/react-storefront-docs.git
cd react-storefront-community.github.io
git fetch
git pull
cd pages-repo
mkdir ${VERSION}
mv ../react-storefront/.storybook/build ${VERSION}/storybook
cp ../react-storefront/docs/build/modules.json ${VERSION}
cp -r ../react-storefront-docs/guides ${VERSION}
mv ../.storybook/build ${VERSION}/storybook
cp ../docs/build/modules.json ${VERSION}
cp -r ../docs-repo/guides ${VERSION}
mv ${VERSION}/guides/guides.json ${VERSION}
sed -i "$ s/$/,\n${VERSION}/" versions.csv
git add -A
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Docs for version ${VERSION}" -a
git commit -am "Docs for version ${VERSION}"
git push -u origin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7b930ba

Please sign in to comment.