-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2 KB
/
main.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
name: CI
on:
push:
branches: [incarnation]
pull_request:
branches: [incarnation]
jobs:
build:
runs-on: ubuntu-latest
outputs:
deploy-url: ${{ steps.pages.outputs.url }}
steps:
- uses: nschloe/action-cached-lfs-checkout@d481127c3821f9c278a6019c39a108ac7004c133 # v1
- name: Gatsby build cache
id: gatsby-cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: |
.cache
public
key: ${{ runner.os }}-gatsby-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-gatsby-
- name: Prepare Node.js and Yarn
uses: ./.github/actions/setup-node-yarn
with:
cache: true
- name: Init deps
run: yarn install
- name: Build
run: yarn build
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Lint
run: yarn lint
- id: pages
name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: public
e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: nschloe/action-cached-lfs-checkout@d481127c3821f9c278a6019c39a108ac7004c133 # v1
- name: Prepare Node.js and Yarn
uses: ./.github/actions/setup-node-yarn
with:
cache: true
- run: yarn install
- run: yarn playwright install --with-deps
- name: Run Playwright tests
env:
RESTIA_E2E_URL: ${{ needs.build.outputs.deploy-url }}
run: yarn playwright test
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 20