Skip to content

Try another action to maximize build space #2

Try another action to maximize build space

Try another action to maximize build space #2

name: Build CarlaSim server container images
on:
workflow_dispatch:
push:
paths:
- carlasim/server/Dockerfile
- .github/workflows/carlasim-server.yml # Self-trigger
env:
REGISTRY: ghcr.io
IMAGE_NAME: bounverif/carla
CARLA_VERSION: 0.9.15
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
server-container-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# - name: Free disk space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Show disk space
run: sudo df -h
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v5
with:
context: carlasim/server
target: carla-server
build-args: |
"CARLA_VERSION=${{ env.CARLA_VERSION }}"
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:server-${{ env.CARLA_VERSION }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max