Skip to content

CI

CI #84

Workflow file for this run

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 }}