generated from Arquisoft/lomap_0
-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (84 loc) · 2.54 KB
/
lomap_es6b.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
80
81
82
83
84
85
86
87
88
89
90
name: CI for LOMAP_ES6B
on:
push:
branches:
- dev
- master
- manuel
- alicia
- adriana
jobs:
unit-test-webapp:
runs-on: ubuntu-latest
defaults:
run:
working-directory: webapp
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci --force
- run: npm test -- --coverage --watchAll=false
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
e2e-tests:
needs: [unit-test-webapp]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm --prefix webapp install --force
- run: npm --prefix webapp run build
env:
CI: ""
- run: npm --prefix webapp run test:e2e
deploy:
needs: [e2e-tests]
name: gh-pages deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm --prefix webapp install --force
- run: PUBLIC_URL=https://uo282249.github.io/lomap_es6b/ npm --prefix webapp run build
env:
CI: ""
- name: Deploy
uses: cpina/github-action-push-to-another-repository@create-branch-if-needed-arg
env:
REACT_APP_GOOGLE_KEY: ${{ secrets.REACT_APP_GOOGLE_KEY }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'webapp/build'
destination-github-username: 'uo282249'
destination-repository-name: 'lomap_es6b'
user-email: [email protected]
commit-message: See ORIGIN_COMMIT from $GITHUB_REF
target-branch: deploy
- name: Test get variable exported by push-to-another-repository
run: echo $DESTINATION_CLONED_DIRECTORY
# docker-push-webapp:
# name: Push webapp Docker Image to GitHub Packages
# runs-on: ubuntu-latest
# needs: [e2e-tests]
# steps:
# - uses: actions/checkout@v3
# - name: Publish to Registry
# uses: elgohr/Publish-Docker-Github-Action@v5
# env:
# API_URI: http://${{ secrets.DEPLOY_HOST }}:5000/api
# with:
# name: arquisoft/lomap_es6b/webapp
# username: ${{ github.actor }}
# password: ${{ secrets.DOCKER_PUSH_TOKEN }}
# registry: ghcr.io
# workdir: webapp
# buildargs: API_URI