error-pages/.github/workflows/tests.yml
2020-07-08 22:18:30 +05:00

56 lines
1.3 KiB
YAML

name: tests
on:
push:
branches:
- master
tags-ignore:
- '**'
pull_request:
jobs: # Docs: <https://git.io/JvxXE>
generate:
name: Try to run generator
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1 # Action page: <https://github.com/actions/setup-node>
with:
node-version: 12
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install
- name: Run generator
run: ./bin/generator.js -c ./config.json -o ./out
- name: Test file creation
run: test -f ./out/ghost/404.html
docker-build:
name: Build docker image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build docker image
run: docker build -f ./Dockerfile --tag image:local .
- name: Run docker image
run: docker run --rm -d -p "8080:8080" -e "TEMPLATE_NAME=ghost" image:local
- name: Pause
run: sleep 2
- name: Send HTTP request
run: curl -sS --fail "http://127.0.0.1:8080/500.html"