forked from zavodil/near-checkers-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: React App Deployment # name of the workflo | ||
|
||
on: | ||
push: | ||
branches: | ||
- ft_checkers # branch name | ||
|
||
jobs: | ||
deploy-react-to-gh-pages: | ||
runs-on: ubuntu-latest | ||
env: | ||
EXAMPLE: example # environment variable | ||
|
||
steps: | ||
# checkout the repository content to github runner | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# setup nodejs environment | ||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
with: | ||
node-version: "18.16.1" | ||
|
||
# cache the dependencies to speed up the build | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
# install dependencies | ||
- name: Install dependencies | ||
run: npm i | ||
|
||
# build the react app | ||
- name: Build | ||
run: npm run build | ||
|
||
# deploy the react app to github pages | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
# NOTE: GITHUB_TOKEN is a secret token that is automatically generated by GitHub | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build # directory to deploy |