From 42c46f3decf88c0d7a29b7a291c9af97664bb424 Mon Sep 17 00:00:00 2001 From: Philipp Caspers <117186241+philipp-caspers@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:02:25 +0200 Subject: [PATCH] ci: Add workflow for release image creation --- .github/workflows/ci.yml | 3 ++ .github/workflows/ci_build_release_image.yml | 34 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/ci_build_release_image.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ec44dd..8c06155 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ jobs: build: needs: build_dev_container uses: ./.github/workflows/ci_build.yml + build_release_image: + needs: build + uses: ./.github/workflows/ci_build_release_image.yml unit_test: needs: build_dev_container uses: ./.github/workflows/ci_unit_test.yml diff --git a/.github/workflows/ci_build_release_image.yml b/.github/workflows/ci_build_release_image.yml new file mode 100644 index 0000000..c44258c --- /dev/null +++ b/.github/workflows/ci_build_release_image.yml @@ -0,0 +1,34 @@ +name: CI Build Release Image +'on': + workflow_call: null +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Cargo build + uses: devcontainers/ci@v0.3 + with: + cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev + runCmd: cargo ament-build --install-base install/voraus-ros-bridge -- --release + push: never + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/voraus-ros-bridge + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}