Skip to content

feat: Add ~/save_snapshot_delayed service with delay, blocking mode, reason tracking, and full documentation #38

feat: Add ~/save_snapshot_delayed service with delay, blocking mode, reason tracking, and full documentation

feat: Add ~/save_snapshot_delayed service with delay, blocking mode, reason tracking, and full documentation #38

Workflow file for this run

name: Docker Image CI
on:
push:
branches: ["main"]
# ensure that version tags also trigger a build, naming convention is `vX.Y.Z`
# make sure the naming convention is followed in tags.
tags:
- "v*"
pull_request:
branches: ["main"]
# permit manual trigger as well
workflow_dispatch:
jobs:
build:
# this only works on jabasai organisation and should be skipped otherwise
if: github.repository_owner == 'jabasai'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Git Checkout
uses: actions/checkout@v5
with:
fetch-depth: 1
# log in to GitHub Container Registry with correct permission
# only works within jabasai organisation and NOT on forks
- name: Docker Login GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# create a docker image name from the github repository name, ensuring lower case and no disallowed characters
- name: create docker image name from github name
id: docker-image-name
run: |
repo_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]' | tr '. ' '-')
echo "image_name=$repo_name" >> $GITHUB_OUTPUT
# set the relevant docker tags and labels
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
org.opencontainers.image.version=${{ github.ref_name }}
images: |
ghcr.io/${{ steps.docker-image-name.outputs.image_name }}
flavor: |
latest=auto
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
- name: setup buildx
uses: docker/setup-buildx-action@v2
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ./.devcontainer/Dockerfile
platforms: linux/amd64 # add other platforms if needed
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: final
build-args: |
BASE_IMAGE=ros:humble
GIT_REPO_VERSION=${{ github.ref_name }}
GIT_REPO_VERSION_DATE=${{ github.event.head_commit.timestamp }}