-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 1.81 KB
/
carlasim-server.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
64
65
66
67
68
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@v10
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
build-mount-path: '/var/lib/docker'
- name: Restart docker
run: sudo service docker restart
- 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
- name: Show final disk space
run: df -h