error-pages/.github/workflows/tests.yml

53 lines
1.2 KiB
YAML
Raw Normal View History

2020-07-08 11:12:21 +00:00
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
2020-07-08 17:15:53 +00:00
run: ./bin/generator.js -c ./config.json -o ./out
2020-07-08 11:12:21 +00:00
- name: Test file creation
run: test -f ./out/ghost/404.html
docker-build:
2020-07-08 11:22:29 +00:00
name: Build docker image
2020-07-08 11:12:21 +00:00
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build docker image
2020-07-08 11:22:29 +00:00
run: docker build -f ./Dockerfile --tag image:local .
- name: Run docker image
2020-07-08 11:24:23 +00:00
run: docker run --rm -d -p "8080:8080" -e "TEMPLATE_NAME=ghost" image:local
2020-07-08 11:22:29 +00:00
- name: Send HTTP request
run: curl -sS --fail "http://127.0.0.1:8080/500.html"