Skip to content

Commit

Permalink
Build and deploy to dist via GitHub CI (react-native-elements#2943)
Browse files Browse the repository at this point in the history
* feat: Added Github Actions for build and deploy to dist

* fix: Yaml syntax

* fix: GitHub Actions CI on push

* feat: Only push on changes to next

* feat: Updated docs

* docs: Getting Started
  • Loading branch information
pranshuchittora authored Apr 10, 2021
1 parent 7fdec69 commit d51f699
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 43 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build-and-deploy-to-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Deploy next to dist
on:
push:
branches:
- next
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Setup Node.js Env
uses: actions/setup-node@v2
with:
node-version: '12'
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
yarn
yarn build
- name: Create local changes
run: |
sed -i -e '/dist/d' .gitignore
git add .
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "New build" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dist
force: true
79 changes: 36 additions & 43 deletions website/docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,65 +12,56 @@ around open source. React Native Elements takes the hassle of assembling these
packages together by giving you a ready made kit with consistent api and look
and feel.

## Installation
### Stable

Installing React Native Elements depends on your type of react native project.
```bash
npm install react-native-elements

# or with yarn
yarn add react-native-elements
```

<div class="toggler">
<ul role="tablist" >
<li id="expo" class="button-expo" aria-selected="false" role="tab" tabindex="0" aria-controls="expo" onclick="displayTab('expo')">
Expo | Create React Native App
</li>
<li id="native" class="button-native" aria-selected="false" role="tab" tabindex="-1" aria-controls="nativetab" onclick="displayTab('native')">
React Native CLI
</li>
</ul>
</div>
### Bleeding Edge

```bash
npm install https://github.com/react-native-elements/react-native-elements#dist

# or with yarn
yarn add https://github.com/react-native-elements/react-native-elements#dist
```

<block class="expo" />
### Install react-native-vector-icons

[Expo](https://expo.io) or
[create-react-native-app](https://github.com/react-community/create-react-native-app)
projects include **react-native-vector-icons** out of the box, so all you need
to do is install **react-native-elements**.
projects include **react-native-vector-icons** out of the box, hence this step can be skipped.

```bash
yarn add react-native-elements
# or with npm
npm install react-native-elements
```
If your project is a standard React Native project created using
`react-native init` (it should have an ios/android directory), then you need to install `react-native-vector-icons`.

Or if you encounter the following error.

> **Note:** If you see the `UNMET PEER DEPENDENCY` warning for
> **react-native-vector-icons** like below, you can ignore it as
> _react-native-vector-icons_ is already installed by _expo_ or _crna_.
>
> <img alt="React Native Vector Icons Unmet Peer Dependency" src={useBaseUrl('img/peer-dep-error.png')} />
<block class="native" />

If your project is a standard React Native project created using
`react-native init` (it should have an ios/android directory), then follow these
installation instructions:
Otherwise run the following command:

### Step 1: Install react-native-elements
> _Manual linking of react-native-vector-icons is not necessary if you're using react-native@0.60.0 or above since it is done automatically. This will throw an error though it won't prevent the application from running. To fix this you'll simply have to run `react-native unlink react-native-vector-icons` and the process will run as expected._
```bash
yarn add react-native-elements
```

### Step 2: Install react-native-vector-icons
npm install react-native-vector-icons

If you have already installed **react-native-vector-icons** as a dependency for
your project you can skip this step. Otherwise run the following command:
# or with yarn
yarn add react-native-vector-icons
```

> _Manual linking of react-native-vector-icons is not necessary if you're using react-native@0.60.0 or above since it is done automatically. This will throw an error though it won't prevent the application from running. To fix this you'll simply have to run `react-native unlink react-native-vector-icons` and the process will run as expected._
Link the dependency

```bash
# yarn
yarn add react-native-vector-icons

# link
react-native link react-native-vector-icons
npx react-native link react-native-vector-icons
```

_If you have any issues installing react-native-vector-icons, check out their
Expand All @@ -79,18 +70,20 @@ installation guide
debug it using
[this issue](https://github.com/react-native-elements/react-native-elements/issues/503)._

### Step 3: Setup react-native-safe-area-context
### Install react-native-safe-area-context

If you have already installed **react-native-safe-area-context** as a dependency for
your project you can skip this step. Otherwise run the following command:

> _Manual linking of react-native-safe-area-context is not necessary if you're using react-native@0.60.0 or above since it is done automatically. This will throw an error though it won't prevent the application from running. To fix this you'll simply have to run `react-native unlink react-native-safe-area-context` and the process will run as expected._
```bash
# yarn
npm install react-native-safe-area-context
# or with yarn
yarn add react-native-safe-area-context
```

> _Manual linking of react-native-safe-area-context is not necessary if you're using react-native@0.60.0 or above since it is done automatically. This will throw an error though it won't prevent the application from running. To fix this you'll simply have to run `react-native unlink react-native-safe-area-context` and the process will run as expected._
# link
```bash
react-native link react-native-safe-area-context
```

Expand Down

0 comments on commit d51f699

Please sign in to comment.