forked from f1tenth/f1tenth_gym
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.59 KB
/
ci.yml
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
name: CI
on:
push:
workflow_dispatch:
inputs:
deploy:
description: 'True to deploy the image to Docker Hub'
required: false
default: false
type: boolean
jobs:
test-build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build .
build-and-push-image:
if: ${{ success() && github.event.inputs.deploy == 'true' }}
needs: test-build-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
shell: bash
run: git fetch --tags -f
- name: Autotag
uses: DanySK/[email protected]
- name: Emit tag as github step output
id: tag
run: echo "tag=$(git describe --tags --exact-match HEAD)" >> $GITHUB_OUTPUT
# # Add support for more platforms with QEMU (optional)
# # https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_MANUANDRU_USERNAME }}
password: ${{ secrets.DOCKERHUB_MANUANDRU_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
file: Dockerfile-gym-ros
platforms: linux/amd64,linux/arm64
tags: manuandru/f1tenth-gym-ros-model-env:latest,manuandru/f1tenth-gym-ros-model-env:${{ steps.tag.outputs.tag }}