generated from Arquisoft/lomap_0
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (91 loc) · 3 KB
/
lomap_es6a.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
91
92
93
94
name: CI for LOMAP ES6A
on: [push, pull_request]
env:
REACT_APP_MAPBOX_KEY: ${{ secrets.REACT_APP_MAPBOX_KEY }}
jobs:
unit-test-webapp:
runs-on: ubuntu-latest
defaults:
run:
working-directory: webapp
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test --coverage --watchAll
- 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
# - run: npm --prefix webapp run build
# - run: npm --prefix webapp run test:e2e
# 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_es6a/webapp
# username: ${{ github.actor }}
# password: ${{ secrets.DOCKER_PUSH_TOKEN }}
# registry: ghcr.io
# workdir: webapp
# buildargs: API_URI
# docker-push-restapi:
# name: Push restapi 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
# with:
# name: arquisoft/lomap_es6a/restapi
# username: ${{ github.actor }}
# password: ${{ secrets.DOCKER_PUSH_TOKEN }}
# registry: ghcr.io
# workdir: restapi
deploy:
needs: [unit-test-webapp]
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
- run: PUBLIC_URL=https://uo282944.github.io/lomap_6a_despliegue/ npm --prefix webapp run build
- name: Deploy
uses: cpina/github-action-push-to-another-repository@create-branch-if-needed-arg
env:
REACT_APP_MAPBOX_KEY: ${{ secrets.REACT_APP_MAPBOX_KEY }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'webapp/build'
destination-github-username: 'uo282944'
destination-repository-name: 'lomap_6a_despliegue'
user-email: '[email protected]'
commit-message: See ORIGIN_COMMIT from $GITHUB_REF
target-branch: gh-pages
- name: Test get variable exported by push-to-another-repository
run: echo $DESTINATION_CLONED_DIRECTORY