Files
react-native-firebase/.github/workflows/publish.yml
2020-05-05 11:05:12 +01:00

47 lines
1.4 KiB
YAML

name: Publish
on:
push:
branches:
- master
jobs:
publish_npm:
if: "contains(toJSON(github.event.commits.*.message), '[publish]')"
name: 'NPM'
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'master'
fetch-depth: 0
- name: Yarn Install
run: yarn --no-audit --prefer-offline
- name: GIT Setup
run: |
git config --global user.name '@Salakar'
git config --global user.email 'Salakar@users.noreply.github.com'
git remote set-url origin git@github.com:$GITHUB_REPOSITORY
- uses: webfactory/ssh-agent@v0.2.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Publish Packages
run: |
yarn logout
echo "@react-native-firebase:registry=http://registry.npmjs.org/" > ~/.npmrc
echo "registry=http://registry.npmjs.org/" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm whoami
git diff --exit-code
yarn lerna publish --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Deploy Documentation
env:
NETLIFY_TRIGGER_URL: ${{ secrets.NETLIFY_TRIGGER_URL }}
run: |
curl -X POST -d {} "$NETLIFY_TRIGGER_URL"