-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 1.92 KB
/
build-test-publish.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
name: Build and Test
on: [push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
env:
PLAYWRIGHT_BROWSERS_PATH: /tmp/_playwright_cache
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Restore playwright cache
uses: actions/cache@v4
with:
path: |
${{ env.PLAYWRIGHT_BROWSERS_PATH }}
key: playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
playwright-
- name: Install dependencies
run: npm ci
- name: Run build
run: APP_ENV=development npm run build
- name: Install test dependencies
run: ./node_modules/.bin/playwright install-deps firefox chromium
- name: Run tests
run: npm run test
- name: Run lint
run: npm run lint
deploy:
runs-on: ubuntu-latest
needs: [test]
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/demo'
environment: ${{ github.ref_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Deploy and wait for completion
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/demo'
uses: digital-blueprint/gitlab-pipeline-trigger-action@v1
with:
host: 'gitlab.tugraz.at'
trigger_token: ${{ secrets.DEPLOY_TRIGGER_TOKEN }}
access_token: ${{ secrets.DEPLOY_ACCESS_TOKEN }}
id: '21238'
ref: 'main'
variables: '{"UPSTREAM_PROJECT_PATH":"dbp/topics/common","UPSTREAM_COMMIT_BRANCH":"${{ github.ref_name }}","UPSTREAM_COMMIT_SHA":"${{ github.ref_name }}"}'