Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/call_jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Call reusable workflows

on:
pull_request:
branches:
- main
- devel
types:
- closed
paths:
- '.github/workflows/reuse-build-and-publish-amd.yml'
- '.devcontainer/devcontainer.json'
- 'Dockerfile'
- 'reinstall-cmake.sh'
- 'VERSION'

jobs:
call-workflow-amd64:
permissions:
contents: read
packages: write
uses: ./.github/workflows/reuse-build-and-publish.yml
with:
image_name: ${{ github.repository }}
ref_name: ${{ github.ref_name }}
actor: ${{ github.actor }}
registry: ghcr.io
secrets: inherit
72 changes: 72 additions & 0 deletions .github/workflows/reuse-build-publish-amd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build and publish amd 64 Docker image

on:
workflow_call:
inputs:
image_name:
description: image name
required: true
type: string
ref_name:
description: ref name
required: true
type: string
actor:
description: actor
required: true
type: string
registry:
description: registry
required: true
type: string
permissions:
contents: read
packages: write

jobs:
reuse-build-and-push:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract version number
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.registry }}/${{ inputs.image_name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=${{ env.VERSION }}
type=sha

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
pull: true
tags: ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.ref_name }}
build-args: |
CONTAINER_VERSION=${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}