Workflow Name Build CRA And Push Static Files To gh-pages Branch #168
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
# When someone pushes to `main` branch, | |
# or when "Workflow Name Upgrade Packages" workflow succeeded, | |
# build the create-react-app project and deploy the static files to `gh-pages` branch | |
name: Workflow Name Build CRA And Push Static Files To gh-pages Branch | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
workflow_run: # Only trigger, when the "Workflow Name Upgrade Packages" workflow succeeded | |
workflows: ["Workflow Name Upgrade Packages"] | |
types: | |
- completed | |
jobs: | |
job_id_build_and_push: | |
name: Job Name Build And Push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Step Name Checkout code | |
uses: actions/checkout@v2 | |
- name: Step Name Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Step Name Build this project | |
run: ./build.sh | |
- name: Step Name Push to gh-pages branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build |