Build project for production π #447
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: Build stage | |
run-name: Build project for production π | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: 3.10.10 | |
NODE_VERSION: 19 | |
steps: | |
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." | |
- name: Set up Python π | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: actions/cache@v2 | |
with: | |
path: ./tools/.bin/.cache | |
key: ${{ runner.os }}-tf-${{ hashFiles('./src/assets/models.json') }} | |
restore-keys: | | |
${{ runner.os }}-tf- | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./requirements.txt | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install npm dependencies | |
run: | | |
npm install | |
- run: echo "π₯οΈ The runner is now ready to build your code." | |
- name: Perform type-checking | |
run: | | |
npm run type-check | |
- name: Download and build tensorflow models | |
run: | | |
./tools/build-models | |
- name: Build the project | |
run: | | |
npm run build-only | |
- run: echo "π This job's status is ${{ job.status }}." |