/
/
/
Top level project for the bag recorder project that adds the frontend and backend together.
1name: CI/CD Pipeline for the bag recorder project
2
3on:
4 push:
5 branches:
6 - main
7
8jobs:
9 build-test-push-frontend:
10 runs-on: ubuntu-latest
11 steps:
12 - name: Checkout repository with submodules
13 uses: actions/checkout@v4
14 with:
15 submodules: recursive
16
17 - name: Set up Docker Buildx
18 uses: docker/setup-buildx-action@v3
19
20 - name: Login to Harbor Registry
21 uses: docker/login-action@v3
22 with:
23 registry: ${{ secrets.HARBOR_URL }}
24 username: ${{ secrets.HARBOR_USERNAME }}
25 password: ${{ secrets.HARBOR_PASSWORD }}
26
27 - name: Install frontend dependencies
28 working-directory: bag_recorder_frontend
29 run: npm ci
30
31 - name: Run frontend lint
32 working-directory: bag_recorder_frontend
33 run: npm run lint
34
35 - name: Run frontend type-check
36 working-directory: bag_recorder_frontend
37 run: npm run type-check
38
39 - name: Build and push frontend image
40 uses: docker/build-push-action@v5
41 with:
42 context: ./bag_recorder_frontend
43 push: true
44 tags: |
45 ${{ secrets.HARBOR_FRONTEND_IMAGE }}:latest
46 ${{ secrets.HARBOR_FRONTEND_IMAGE }}:${{ github.sha }}
47 cache-from: type=registry,ref=${{ secrets.HARBOR_FRONTEND_IMAGE }}:buildcache
48 cache-to: type=registry,ref=${{ secrets.HARBOR_FRONTEND_IMAGE }}:buildcache,mode=max
49
50 build-test-push-backend:
51 runs-on: ubuntu-latest
52 steps:
53 - name: Checkout repository with submodules
54 uses: actions/checkout@v4
55 with:
56 submodules: recursive
57
58 - name: Set up Docker Buildx
59 uses: docker/setup-buildx-action@v3
60
61 - name: Login to Harbor Registry
62 uses: docker/login-action@v3
63 with:
64 registry: ${{ secrets.HARBOR_URL }}
65 username: ${{ secrets.HARBOR_USERNAME }}
66 password: ${{ secrets.HARBOR_PASSWORD }}
67
68 - name: Build and push backend image
69 uses: docker/build-push-action@v5
70 with:
71 context: ./bag_recorder_backend
72 push: true
73 tags: |
74 ${{ secrets.HARBOR_BACKEND_IMAGE }}:latest
75 ${{ secrets.HARBOR_BACKEND_IMAGE }}:${{ github.sha }}
76 cache-from: type=registry,ref=${{ secrets.HARBOR_BACKEND_IMAGE }}:buildcache
77 cache-to: type=registry,ref=${{ secrets.HARBOR_BACKEND_IMAGE }}:buildcache,mode=max
78 build-args: |
79 ROS_DISTRO=humble
80