-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (59 loc) · 1.62 KB
/
build-frontend.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
61
62
63
64
65
66
67
68
69
70
71
72
name: Build frontend
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
paths: [ 'frontend/**' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
working-directory: frontend/
run: npm install
- name: Build
working-directory: frontend/
run: npm run build
# - name: Lint
# working-directory: frontend/
# run: npm run lint
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: frontend
path: frontend/
retention-days: 1
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: frontend
path: frontend/
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push latest
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: frontend/
push: true
tags: spoud/toeggelomat-frontend:latest
- name: Build and push tag
if: startsWith(github.event.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: backend/
file: backend/src/main/docker/Dockerfile.jvm
push: true
tags: spoud/toeggelomat-backend:${{ github.ref_name }}