add "env" to github workflow yml #4
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
name: Deploy to GitHub Pages | |
on: | |
push: | |
paths: | |
- 'front-end/**' # Trigger only when changes occur in the ./front-end folder | |
- '.github/workflows/**' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.0' | |
- 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. | |
env: | |
REACT_APP_API_URL=${{ secrets.MY_HEROKU_API }} | |
REACT_APP_API_WORKS=false | |
run: | # the secret bellow is a varible I defined in the repo GitHub's settings | |
npm install | |
npm run build | |
working-directory: ./front-end | |
- name: Deploy 馃殌 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: ./front-end/build |