-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (32 loc) · 1.15 KB
/
build-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Build & Test
on:
push:
branches: "**"
pull_request:
branches: [main]
# env:
# DOCKER_ENV_FILE: ".github/workflows/docker.env"
jobs:
build-test:
runs-on: ubuntu-latest
# services:
# alpine:
# image: alpine
steps:
- uses: actions/checkout@v3
- name: docker build
uses: docker/build-push-action@v3
with:
push: false
tags: allaboutapps.dev/cra-template:${{ github.sha }}
# volumes: /var/run/docker.sock:/var/run/docker.sock
- name: docker run
run: docker run -d --name=container -it allaboutapps.dev/cra-template:${{ github.sha }}
- name: create-react-app
run: docker exec container yarn create react-app my-app-ci --template file://cra-template/
- name: build (scaffolded project)
run: docker exec container bash -c "cd my-app-ci && yarn build && yarn lint"
- name: test (scaffolded project)
run: docker exec container bash -c "cd my-app-ci && yarn test"
- name: test docker-entrypoint.sh patching
run: docker exec container bash -c "cd my-app-ci && ./scripts/test-docker-entrypoint.sh"