/
/
/
1name: CI/CD Pipeline for the fast slam project
2
3on:
4 push:
5 branches:
6 - main
7
8env:
9 REGISTRY: ${{ secrets.HARBOR_URL }}
10 PROJECT: docker
11 ROS_REPO: fast-slam-ros
12 SIM_REPO: fast-slam-sim
13
14jobs:
15 build:
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 ros image
36 uses: docker/build-push-action@v5
37 with:
38 context: .
39 push: true
40 target: ros
41 tags: |
42 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.ROS_REPO }}:latest
43 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.ROS_REPO }}:${{ github.sha }}
44 cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.ROS_REPO }}:latest
45 build-args: ROS_DISTRO=jazzy
46
47 - name: Build and push sim image
48 uses: docker/build-push-action@v5
49 with:
50 context: .
51 push: true
52 target: sim
53 tags: |
54 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.SIM_REPO }}:latest
55 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.SIM_REPO }}:${{ github.sha }}
56 cache-from: |
57 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.ROS_REPO }}:latest
58 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.SIM_REPO }}:latest
59 build-args: ROS_DISTRO=jazzy
60