Files
palkkakysely/.github/workflows/build.yml
2021-02-22 14:48:06 +02:00

61 lines
1.6 KiB
YAML

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# Update automatically on weekdays during work hours
- cron: '0 10,13,16 * * 1-5'
# ... and every night
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r requirements.txt
- name: Build
run: make -j3
- uses: actions/setup-node@v2
with:
node-version: '12'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn
working-directory: analysaattori
- run: yarn build
working-directory: analysaattori
env:
GENERATE_SOURCEMAP: 'false'
- run: cp -a analysaattori/build ./out/analysaattori
- run: ls -laR out
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
folder: out