Skip to content

Commit

Permalink
added docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Jul 3, 2024
1 parent 0af9a5d commit 6834c7b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .ci/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'echo "$0: \"${last_command}\" command failed with exit code $?' ERR

git clone https://github.com/ctu-mrs/mrs_docker
cd mrs_docker/recipes

docker login --username klaxalk --password $TOKEN

# docker build . --file docker/without_linux_setup --tag ctumrs/mrs_uav_system:latest

docker buildx create --name container --driver=docker-container
docker buildx build --push . --file Dockerfile --builder container --tag ctumrs/mrs_uav_system:latest --platform=linux/amd64,linux/arm64

WEEK_TAG="`date +%Y`_w`date +%V`"
docker tag ctumrs/mrs_uav_system:latest ctumrs/mrs_uav_system:$WEEK_TAG

docker buildx imagetools create -t ctumrs/mrs_uav_system:latest ctumrs/mrs_uav_system:$WEEK_TAG --push
1 change: 1 addition & 0 deletions .ci/build_docker_multiarch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/bash
24 changes: 24 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: docker

on:

workflow_dispatch:

schedule:
- cron: '0 10 * * *'

jobs:

generate-jobs:
needs: init-artifacts
runs-on: ubuntu-20.04
env:
TOKEN: ${{ secrets.DOCKERHUB }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- id: build
run: |
./.ci/build_docker.sh

0 comments on commit 6834c7b

Please sign in to comment.