Skip to content

fix issue when summary not available #312

fix issue when summary not available

fix issue when summary not available #312

Workflow file for this run

name: Build
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
name: Build
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- folder: "dist/prod"
branch: "dist"
npmrunparam: "build"
- folder: "dist/sandbox"
branch: "dist-sandbox"
npmrunparam: "buildsandbox"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install
- name: Build files
run: npm run ${{ matrix.npmrunparam }}
- name: Create scoring.json
# the output file name is relatived to create_scoring.sh,
run: |
./create_scoring/create_scroring_json.sh "../${{ matrix.folder }}/scoring.json"
echo "#####################"
find ./dist
- name: Commit built files to the ${{ matrix.branch }} branch
if: github.ref == 'refs/heads/master'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: ${{ matrix.branch }}
FOLDER: ${{ matrix.folder }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Deploy on staging
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master'
needs:
- build
steps:
- name: Deploy on staging
# CURL options:
# -f : GitHub workflow fail if the HTTP status code is not 200
# see API on https://infra.text-analytics.ch/api/webstatic/
# $GITHUB_REPOSITORY is replaced by the repository name, for example bitem-heg-geneve/ebiodiv-matching-frontend
run: |
curl -f -X 'POST' "https://infra.text-analytics.ch/api/webstatic/deploy/github.com/${{ github.repository }}/dist-sandbox" \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'secret_key=${{secrets.SECRET_KEY}}'