Skip to content

Merge pull request #88 from LuisEnMarroquin/develop #39

Merge pull request #88 from LuisEnMarroquin/develop

Merge pull request #88 from LuisEnMarroquin/develop #39

Workflow file for this run

name: Prod deploy
on:
push:
branches:
- main
jobs:
deploy:
if: github.repository == 'LuisEnMarroquin/json-as-xlsx'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn test
- run: yarn build
- name: Copy files to library output folder
run: |
cp README.md packages/main-library/README.md
cp LICENSE packages/main-library/LICENSE
- name: Set environment variable for GitHub
run: |
echo "CURRENT_VERSION=$(node -e "console.log('v' + require('./package.json').version)")" >> $GITHUB_ENV
echo CURRENT_VERSION ${{ env.CURRENT_VERSION }}
working-directory: packages/main-library/
- name: Publish package to NPM registry
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
npm publish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.TOKEN_NPM }}
working-directory: packages/main-library/
- name: Create a new GitHub release
run: |
echo ${{ secrets.TOKEN_GITHUB }} > nothing.md
gh auth login --with-token < nothing.md
gh release create ${{ env.CURRENT_VERSION }} -F README.md -t "Released ${{ env.CURRENT_VERSION }}"
- name: Prepare static files for deployment
run: yarn run static
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
branch: gh-pages
git-config-name: LuisEnMarroquin
git-config-email: mluis651@gmail.com