/
/
/
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
8env:
9 REGISTRY: ${{ secrets.HARBOR_URL }}
10 PROJECT: docker
11 FRONTEND_REPO: bag-recorder-frontend
12 BACKEND_REPO: bag-recorder-backend
13
14jobs:
15 build-test-push-frontend:
16 runs-on: ubuntu-latest
17 steps:
18 - name: Checkout repository with submodules
19 uses: actions/checkout@v4
20 with:
21 submodules: recursive
22
23 - name: Set up Docker Buildx
24 uses: docker/setup-buildx-action@v3
25 with:
26 driver: docker
27
28 - name: Login to Harbor Registry
29 uses: docker/login-action@v3
30 with:
31 registry: ${{ env.REGISTRY }}
32 username: ${{ secrets.HARBOR_USERNAME }}
33 password: ${{ secrets.HARBOR_PASSWORD }}
34
35 - name: Build and push frontend image
36 uses: docker/build-push-action@v5
37 with:
38 context: ./bag_recorder_frontend
39 push: true
40 tags: |
41 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.FRONTEND_REPO }}:latest
42 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.FRONTEND_REPO }}:${{ github.sha }}
43 cache-from: |
44 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.FRONTEND_REPO }}:latest
45
46 build-test-push-backend:
47 runs-on: ubuntu-latest
48 needs: build-test-push-frontend
49 steps:
50 - name: Checkout repository with submodules
51 uses: actions/checkout@v4
52 with:
53 submodules: recursive
54
55 - name: Set up Docker Buildx
56 uses: docker/setup-buildx-action@v3
57 with:
58 driver: docker
59
60 - name: Login to Harbor Registry
61 uses: docker/login-action@v3
62 with:
63 registry: ${{ env.REGISTRY }}
64 username: ${{ secrets.HARBOR_USERNAME }}
65 password: ${{ secrets.HARBOR_PASSWORD }}
66
67 - name: Build and push backend image
68 uses: docker/build-push-action@v5
69 with:
70 context: ./bag_recorder_backend
71 push: true
72 tags: |
73 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.BACKEND_REPO }}:latest
74 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.BACKEND_REPO }}:${{ github.sha }}
75 cache-from: |
76 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.BACKEND_REPO }}:latest
77 build-args: |
78 ROS_DISTRO=humble
79