Skip to content

Commit

Permalink
Handle update of fog-ros-baseimage
Browse files Browse the repository at this point in the history
  • Loading branch information
maseabunikie committed May 2, 2022
1 parent 8efc435 commit 2329730
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build

on:
repository_dispatch:
types: [fog-ros-baseimage-update]
push:

jobs:
Expand All @@ -11,6 +13,18 @@ jobs:

- uses: docker/setup-buildx-action@v1

- 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
run: |
echo "IMAGE_TAG_FORMAT=type=sha,suffix=-${{ github.event.client_payload.run_attempt }}" >> $GITHUB_ENV
if: github.event_name == 'repository_dispatch'

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
Expand All @@ -19,8 +33,8 @@ jobs:
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
type=raw,value=latest
${{ env.IMAGE_TAG_FORMAT }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . /main_ws/src/
# this:
# 1) builds the application
# 2) packages the application as .deb & writes it to build_output/
RUN /packaging/build-and-package-as-deb.sh -o build_output/
RUN /packaging/build.sh

# ▲ runtime ──┐
# └── build ▼
Expand Down

0 comments on commit 2329730

Please sign in to comment.