Skip to content

Bump docker/setup-buildx-action from 2 to 3 #124

Bump docker/setup-buildx-action from 2 to 3

Bump docker/setup-buildx-action from 2 to 3 #124

name: tii-depthai-ctrl
on:
repository_dispatch:
types: [fog-ros-baseimage-update]
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: docker/setup-buildx-action@v3
- name: Set image tag format without suffix
run: |
echo "IMAGE_TAG_FORMAT=type=sha" >> $GITHUB_ENV
if: github.event_name == 'push'
- name: Set image tag format with suffix
# it is possible that run_number should be used instead run_attempt
# run_attempt is unique number on every run and run_attempt resets to 1 if re-build is not used
# content of image_sha_tag_suffix is defined in fog-ros-baseimage dispatcher workflow.
run: |
echo "IMAGE_TAG_FORMAT=type=sha,suffix=-${{ github.event.client_payload.image_sha_tag_suffix }}" >> $GITHUB_ENV
if: github.event_name == 'repository_dispatch'
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/tiiuae/tii-depthai-ctrl
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=raw,value=latest
${{ env.IMAGE_TAG_FORMAT }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container image and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}