π§π½βπΌ update node version (#1301) #665
This file contains hidden or 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 Dev | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: | |
- dev | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3.3.0 | |
# Run yarn build | |
- name: run yarn build | |
uses: actions/setup-node@v3.6.0 | |
with: | |
node-version: "18" | |
check-latest: true | |
- name: Install and Build | |
env: | |
# set CI to false because warnings are treated as errors if CI=true | |
# manually set react env here because NODE_ENV=production on build | |
CI: false | |
REACT_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} | |
REACT_APP_ENV: development | |
run: yarn install && yarn run build | |
- name: save build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: frontend-build | |
path: ${{ github.workspace }}/frontend/build | |
retention-days: 1 | |
if-no-files-found: error | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3.3.0 | |
- name: Downloading build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend-build | |
# Use the path artifacts because frontend/build is in gitignore | |
path: ${{ github.workspace }}/frontend/artifacts | |
- name: Install Heroku CLI | |
run: | | |
curl https://cli-assets.heroku.com/install.sh | sh | |
- name: Deploy to Heroku | |
uses: AkhileshNS/heroku-deploy@v3.12.13 | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
heroku_app_name: "mentee-dev" | |
heroku_email: "h4i.mentee.auth@gmail.com" | |
branch: dev | |
dontuseforce: false # This allows force pushing to Heroku |