π£ββοΈ Thread chat (#1104) #541
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 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/[email protected] | |
# Run yarn build | |
- name: run yarn build | |
uses: actions/[email protected] | |
with: | |
node-version: "16" | |
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/[email protected] | |
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/[email protected] | |
- name: Downloading build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-build | |
# Use the path artifacts because frontend/build is in gitignore | |
path: ${{ github.workspace }}/frontend/artifacts | |
- name: Deploy to Heroku | |
uses: AkhileshNS/[email protected] | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
heroku_app_name: "mentee-dev" | |
heroku_email: "[email protected]" | |
branch: dev |