release: 0.13.0-beta.1 #1212
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 | |
on: | |
push: | |
branches: [updates, next] | |
pull_request: | |
branches: [main, beta, updates, next] | |
jobs: | |
npm_build_frontend: | |
name: Build frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
id: cache | |
env: | |
cache-name: cache-node-modules-frontend-v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} | |
- name: Cache npm cache | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-npm-cache-frontend-v2 | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- name: Install frontend dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci --prefer-offline --no-audit | |
- name: Build frontend | |
run: npm run build | |
npm_build_backend: | |
name: Build backend | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
id: cache | |
env: | |
cache-name: cache-node-modules-backend-v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('backend/package-lock.json') }} | |
- name: Cache npm cache | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-npm-cache-backend-v2 | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('backend/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- name: Install backend dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci --prefer-offline --no-audit | |
- name: Link backend dependencies in `/common` | |
run: ln -s ../backend/node_modules ../common/node_modules | |
- name: Build backend | |
run: npm run build | |
docker_build: | |
name: Build docker image | |
needs: | |
- npm_build_frontend | |
- npm_build_backend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build | |
uses: docker/build-push-action@v4 | |
with: | |
push: false | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |