build(deps): bump cookie, express and socket.io in /backend #328
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: 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@v2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: '16' | |
| - name: Cache node modules | |
| uses: actions/cache@v2 | |
| 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@v2 | |
| 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 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: '16' | |
| - name: Cache node modules | |
| uses: actions/cache@v2 | |
| 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@v2 | |
| 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: Copy package.json into root | |
| run: mv backend/package*.json . | |
| - name: Install backend dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: npm ci --prefer-offline --no-audit | |
| - name: Build backend | |
| run: cd backend && tsc | |
| 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@v1 | |
| with: | |
| version: v0.6.0 | |
| - name: Build | |
| uses: docker/build-push-action@v2 | |
| with: | |
| push: false | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |