/
/
/
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 steps:
49 - name: Checkout repository with submodules
50 uses: actions/checkout@v4
51 with:
52 submodules: recursive
53
54 - name: Set up Docker Buildx
55 uses: docker/setup-buildx-action@v3
56 with:
57 driver: docker
58
59 - name: Login to Harbor Registry
60 uses: docker/login-action@v3
61 with:
62 registry: ${{ env.REGISTRY }}
63 username: ${{ secrets.HARBOR_USERNAME }}
64 password: ${{ secrets.HARBOR_PASSWORD }}
65
66 - name: Build and push backend image
67 uses: docker/build-push-action@v5
68 with:
69 context: ./bag_recorder_backend
70 push: true
71 tags: |
72 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.BACKEND_REPO }}:latest
73 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.BACKEND_REPO }}:${{ github.sha }}
74 cache-from: |
75 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.BACKEND_REPO }}:latest
76 build-args: |
77 ROS_DISTRO=humble
78