generated from taylorbryant/gatsby-starter-tailwind
-
-
Notifications
You must be signed in to change notification settings - Fork 127
79 lines (66 loc) · 2.31 KB
/
nodejs.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: 'Continuous integration'
on: [push, pull_request]
jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v4
with:
paths_ignore: '["**/README.md"]'
concurrent_skipping: 'same_content_newer'
build:
name: Test build
runs-on: 'ubuntu-latest'
environment: "Preview"
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v2.5.0
with:
node-version: '18'
- name: 'Checkout Project'
uses: 'actions/checkout@v2'
with:
fetch-depth: 1
- name: Install dependencies
run: yarn install --no-progress
- name: Lint code
run: yarn lint
- name: Run unit tests
run: yarn test
if: ${{ github.event_name == 'pull_request' }}
- name: Build project
run: yarn build
if: ${{ github.event_name != 'pull_request' }}
test-docker-compose:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Build the dev container
run: docker-compose build --no-cache --progress plain
env:
SIRV_CLIENT_SECRET_RO: ${{ secrets.SIRV_CLIENT_SECRET_RO }}
SIRV_CLIENT_SECRET_RW: ${{ secrets.SIRV_CLIENT_SECRET_RW }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
AUTH0_CLIENT_SECRET: ${$ secrets.AUTH0_CLIENT_SECRET }}
AUTH0_MGMT_CLIENT_SECRET: ${$ secrets.AUTH0_MGMT_CLIENT_SECRET }}
- name: Start docker compose
run: docker-compose up -d
env:
SIRV_CLIENT_SECRET_RO: ${{ secrets.SIRV_CLIENT_SECRET_RO }}
- name: Wait for the site to be online
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 180 localhost:3000 -- echo "Site is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3
- name: Stop containers
if: always()
run: docker-compose down