-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (73 loc) · 2.25 KB
/
Copy pathdocker-amd64.yml
File metadata and controls
82 lines (73 loc) · 2.25 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
name: Build Lyrical / Jetty Docker image (AMD64)
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- ".docker/**"
- ".dockerignore"
- ".github/workflows/docker-amd64.yml"
- "posim_interfaces/**"
- "examples/**"
- "extras/**"
- "gazebo/**"
- "models/**"
- "README.md"
push:
tags: ["v*"]
branches: [main]
env:
IMAGE_NAME: ioeslab/posim
ROS_DISTRO: lyrical
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-push-to-docker-hub:
# Never execute untrusted fork code on a self-hosted runner.
if: >-
vars.POSIM_ENABLE_DOCKER_CI == 'true' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: [self-hosted, x64]
timeout-minutes: 1440
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
if: vars.POSIM_PUBLISH_IMAGES == 'true' && github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
suffix=-amd64
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build Docker image
uses: docker/build-push-action@v7
with:
context: .
push: ${{ vars.POSIM_PUBLISH_IMAGES == 'true' && github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: .docker/lyrical.amd64.dockerfile
platforms: linux/amd64
build-args: |
ROS_DISTRO=${{ env.ROS_DISTRO }}