Void/.github/workflows/build.yml

44 lines
1.1 KiB
YAML

name: 'build'
on:
push:
branches: [ dev, v0 ]
paths-ignore:
- 'readme.md'
- 'LICENSE'
- 'config.example.toml'
- '.gitignore'
pull_request:
branches: [ dev ]
paths-ignore:
- 'readme.md'
- 'LICENSE'
- 'config.example.toml'
- '.gitignore'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout'
uses: actions/checkout@v2
with:
ref: ${{ github.sha }}
- name: 'setup node 14'
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: 'restore deps'
id: cache-restore
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- name: create config
run: echo -e "[uploader]\nlength = 6\ndirectory = './uploads'" > config.toml
- name: install deps
if: steps.cache-restore.outputs.cache-hit != 'true'
run: yarn install
- name: build
run: yarn build
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}