forked from ros2/ros2_documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (22 loc) · 803 Bytes
/
Copy pathdocker-image.yml
File metadata and controls
27 lines (22 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: Build & Run Docker Image
on:
pull_request:
# Only kick workflow if docker files or this workflow are changed
paths:
- 'docker/**'
- '.github/workflows/docker-image.yml'
jobs:
validate:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history including branches and tags
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build --rm --build-arg user=$(id -un) --build-arg uid=$(id -u) -f ./docker/image/Dockerfile -t test-image:latest .
- name: Run container and verify
run: |
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/tmp/doc_repository test-image:latest