-
Notifications
You must be signed in to change notification settings - Fork 43
60 lines (59 loc) · 1.77 KB
/
javascript.yaml
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
name: JavaScript files
on:
push:
branches:
- dev
paths:
- "frontend-project/**"
- ".github/**"
- 'Makefile'
pull_request:
paths:
- "frontend-project/**"
- ".github/**"
- 'Makefile'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2
- name: Set up Node 14.x
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # renovate: tag=v2
with:
node-version: "14.x"
- name: Install
run: yarn
working-directory: ./frontend-project/
- name: Lint
run: yarn lint
working-directory: ./frontend-project/
- name: Typecheck
run: yarn tsc
working-directory: ./frontend-project/
- name: Build
run: yarn build
working-directory: ./frontend-project/
env:
COMMIT_SHA: "{{github.sha}}"
COMMIT_BRANCH: "{{github.ref}}"
- name: Test
run: yarn test
working-directory: ./frontend-project/
deploy:
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2
- name: Build production image
run: make build_frontend
- name: "Docker login"
if: github.ref == 'refs/heads/dev'
env:
DOCKER_REGISTRY_URL: docker-registry.siecobywatelska.pl
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin ${DOCKER_REGISTRY_URL}
- name: Push image
if: github.ref == 'refs/heads/dev'
run: make push_frontend