Skip to content

Merge pull request #23 from React95/chore/dps #23

Merge pull request #23 from React95/chore/dps

Merge pull request #23 from React95/chore/dps #23

name: React95 Gatsby Theme - Publish workflow
on:
push:
branches:
- master
jobs:
build_and_publish:
runs-on: ubuntu-latest
if: startsWith(github.event.head_commit.message, 'Merge')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Restoring cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Configure CI Git User
run: |
git remote set-url origin https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git config --global user.email ggdaltoso@gmail.com
git config --global user.name ggdaltoso
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: yarn --pure-lockfile --non-interactive
- name: Build
run: |
yarn build
- name: Publish
run: |
GH_TOKEN=${GH_TOKEN}
NPM_TOKEN=${NPM_TOKEN}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
yarn lerna publish --yes
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy example to GH Pages
run: |
GH_TOKEN=${GH_TOKEN}
yarn lerna run deploy --scope=example
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}