-
Notifications
You must be signed in to change notification settings - Fork 21
56 lines (48 loc) · 1.76 KB
/
push_gisnav_images.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
name: Push latest GISNav multi-arch Docker images to GHCR
on:
#push:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows running manually from the Actions tab
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
upload:
runs-on: ubuntu-20.04
timeout-minutes: 120
defaults:
run:
shell: bash
steps:
- name: Checkout GISNav
uses: actions/checkout@v3
with:
path: colcon_ws/src/gisnav
fetch-depth: 0 # need for building docs (conf.py git describe)
fetch-tags: True # need for building docs (conf.py git describe)
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract git tag from GITHUB_REF
run: echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')
- name: Setup Docker Buildx
run: |
docker buildx create --use
# TODO: try to use docker-compose.yaml file to avoid having to specify redundant build args here
# Remove some directories and apt dependencies to free up disk space
# for the multi-arch image
- name: Build and push GISNav multi-arch Docker images
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
cd colcon_ws/src/gisnav
docker buildx build --build-arg ROS_VERSION=humble --push --platform linux/amd64,linux/arm64 -f docker/mavros/Dockerfile --target gisnav -t ghcr.io/hmakelin/gisnav:${TAG:-latest} .