Skip to content

Commit 97d1910

Browse files
committed
workflows: add builds for ros distros
1 parent e088489 commit 97d1910

1 file changed

Lines changed: 39 additions & 9 deletions

File tree

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,49 @@
1-
name: Weekly Quay rebuild
1+
name: Weekly ROS Docker Builds
22

33
on:
44
schedule:
5-
- cron: "0 3 * * 1"
5+
- cron: "0 3 * * 1" # Weekly, Monday at 03:00 UTC
66
workflow_dispatch:
77

88
jobs:
9-
trigger:
9+
build-and-push:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
ros_distro: [jazzy, humble, rolling, kilted]
14+
15+
env:
16+
QUAY_REPO: quay.io/carologistics/clips_executive_base_image
17+
DATE_TAG: ${{ github.run_date }} # ISO date
18+
COMMIT_SHA: ${{ github.sha }}
1119

1220
steps:
13-
- name: Trigger Quay build for all ROS distros
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to Quay
28+
uses: docker/login-action@v2
29+
with:
30+
registry: quay.io
31+
username: carologistics+api_bot
32+
password: ${{ secrets.quay_bot }}
33+
34+
- name: Build Docker image
35+
run: |
36+
echo "Building ROS distro: ${{ matrix.ros_distro }}"
37+
docker build \
38+
-f Dockerfile \
39+
--build-arg ROS_DISTRO=${{ matrix.ros_distro }} \
40+
-t $QUAY_REPO:${{ matrix.ros_distro }} \
41+
-t $QUAY_REPO:${{ matrix.ros_distro }}-${DATE_TAG} \
42+
-t $QUAY_REPO:${{ matrix.ros_distro }}-${COMMIT_SHA::8} \
43+
.
44+
45+
- name: Push Docker image
1446
run: |
15-
for tag in jazzy humble rolling kilted; do
16-
curl -X POST "${{ secrets.QUAY_TRIGGER_URL }}" \
17-
-H "Content-Type: application/json" \
18-
-d '{"docker_tags":["'$tag'","'$tag'-'$(date +%Y-%m-%d)'"]}'
19-
done
47+
docker push $QUAY_REPO:${{ matrix.ros_distro }}
48+
docker push $QUAY_REPO:${{ matrix.ros_distro }}-${DATE_TAG}
49+
docker push $QUAY_REPO:${{ matrix.ros_distro }}-${COMMIT_SHA::8}

0 commit comments

Comments
 (0)