Repository navigation
93 lines (92 loc) · 3.41 KB
/
Copy pathdevelop-ui.yaml
File metadata and controls
93 lines (92 loc) · 3.41 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Develop UI CI/CD
on:
push:
paths:
- 'frontend/**'
# The viewer (FW Lite) is covered by pr.yaml / fw-lite.yaml and ships via FwLiteShared/wwwroot, not the UI image.
- '!frontend/viewer/**'
- '.github/workflows/develop-ui.yaml'
- '.github/workflows/lexbox-ui.yaml'
- '.github/workflows/deploy.yaml'
branches:
- develop
pull_request:
paths:
- 'frontend/**'
- '!frontend/viewer/**'
- '.github/workflows/develop-ui.yaml'
- '.github/workflows/lexbox-ui.yaml'
- '.github/workflows/deploy.yaml'
branches:
- develop
jobs:
set-version:
name: Set Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.setVersion.outputs.VERSION }}
steps:
- name: Set Version
id: setVersion
# set version to date in vYYYY-MM-DD-commitSha format
run: |
shortSha=$(echo ${{ github.sha }} | cut -c1-8)
echo "VERSION=v$(date --rfc-3339=date)-$shortSha" >> ${GITHUB_OUTPUT}
build-ui:
name: Build UI
needs: set-version
permissions:
contents: read
checks: write # publish-unit-test-result-action
packages: write # ghcr.io push
uses: ./.github/workflows/lexbox-ui.yaml
with:
version: ${{ needs.set-version.outputs.version }}
deploy-api:
name: Deploy API
if: ${{github.ref == 'refs/heads/develop'}}
needs: [ build-ui, set-version ]
uses: ./.github/workflows/deploy.yaml
secrets: inherit
with:
version: ${{ needs.set-version.outputs.version }}
image: 'ghcr.io/sillsdev/lexbox-ui'
k8s-environment: develop
deploy-domain: lexbox.dev.languagetechnology.org
check-and-lint:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write # eslint-annotate-action
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
package_json_file: 'frontend/package.json'
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: './frontend/package.json'
cache: 'pnpm'
cache-dependency-path: './frontend/pnpm-lock.yaml'
- run: pnpm install
- run: pnpm svelte-kit sync # generate frontend/.svelte-kit, so the viewer can build 🤔
- run: pnpm run -r build # We need code/types generated by the build (e.g. gql/generated)
- run: pnpm run check:deps
- name: Svelte-Check PR Annotator
uses: ./.github/actions/svelte-check-problem-matcher
- id: svelte_check
#using workspace package.json as a hack, github problem matcher requires the fromPath to match a file not the folder of the workspace
run: pnpm run -r --no-bail --parallel --aggregate-output --reporter-hide-prefix check --output machine --workspace package.json
- run: pnpm run -r --no-bail --parallel --aggregate-output lint:report
if: ${{ always() && steps.svelte_check.outcome != 'cancelled' }}
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@5a8d8ab89a57679e90c32750e0f382e9d8570750 # 4.0.0
if: always()
with:
only-pr-files: false
report-json: |
./frontend/eslint_report.json
./frontend/viewer/eslint_report.json