-
Notifications
You must be signed in to change notification settings - Fork 39
68 lines (68 loc) · 1.76 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
name: Main
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- '.vscode/**'
- '.husky/**'
- '.devcontainer/**'
pull_request:
paths-ignore:
- '**/*.md'
- '.vscode/**'
- '.husky/**'
- '.devcontainer/**'
jobs:
test:
name: Test
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/[email protected]
- name: Initialize Node.js
uses: ./.github/actions/init-node
- name: Run tests
run: pnpm run -r --include-workspace-root '/^test:(?!markdown\b|proxy-coverage\b|server-coverage\b|loaders\b)/'
env:
FORCE_COLOR: 1
STAGING: 1
- name: Upload web assets
if: github.ref == 'refs/heads/main'
uses: actions/[email protected]
with:
name: web-client-assets-${{ github.sha }}
retention-days: 1
include-hidden-files: true
path: |
web/dist/
web/routes.regexp
staging:
name: Web Staging Deploy
needs: test
if: github.ref == 'refs/heads/main'
permissions:
contents: read
id-token: write
concurrency:
group: staging-web
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/[email protected]
- name: Download web assets from test step
uses: actions/[email protected]
with:
name: web-client-assets-${{ github.sha }}
path: web/
- name: Deploy to Google Cloud
uses: ./.github/actions/deploy
with:
projectId: slowreader-452120
region: europe-west1
folder: ./web/
registry: staging/web
service: staging-web