Skip to content

build

build #118

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: build
on:
push:
branches: [main]
pull_request:
# run this workflow every day to update CACTUS data
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Nodejs
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Download CACTUS data
run: ./update_cactus_data.sh
- name: lint, format & build
run: |
npm run lint
npm run format
npm run build
- name: deploy
if: ${{ github.ref == 'refs/heads/main' }}
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git config --global user.name "cactus+githubci"
git config --global user.email "cactus+githubci@users.noreply.github.com"
git remote set-url origin https://x-access-token:${NODE_AUTH_TOKEN}@github.com/cactus-costing/map.git
npm run deploy