This Action will Build your React Project and deploy it to Github Pages
2. Create a Github Actions Workflow file and add this to it (and replace "YourGithubName" and "YourRepoName" with the names)
name: Build React App
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: write # Permission for Action
jobs:
build_react:
runs-on: ubuntu-latest
name: Build React
steps:
- uses: actions/checkout@v2
- id: Build-React-App
uses: BitDEVil2K16/ReactPagesAction@1.0.2
with:
username: 'YourGithubName'
reponame: 'YourRepoName'
token: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
Name | Description | Default | Required |
---|---|---|---|
username | Your username | - | ✅ |
reponame | Your repository name | - | ✅ |
token | Please leave this line unchanged | - | ✅ |
gitemail | Git commit email | CI@example.com | ❌ |
gitname | Git commit name | CI | ❌ |
gitmsg | Git commit message | deploy | ❌ |
cname | Custom domain | - | ❌ |
useyarn | Use yarn to build | false | ❌ |
Change in package.json
your Homepage and append cname in your yml.
After token:
cname: 'yourcustomDomain.tdl'
Full example with custom domain
name: Build React App
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: write
jobs:
build_react:
runs-on: ubuntu-latest
name: Build React
steps:
- uses: actions/checkout@v2
- id: Build-React-App
uses: BitDEVil2K16/ReactPagesAction@1.0.2
with:
username: 'YourGithubName'
reponame: 'YourRepoName'
token: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
cname: 'example.com'
The scripts and documentation in this project are released under the MIT License.