Skip to content

Commit

Permalink
Use version passed as input
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo committed Jan 13, 2025
1 parent b949744 commit 78326a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/baseimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ concurrency:
group: 'service-base'
cancel-in-progress: true

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
version:
description: 'Version tag for the images'
required: false
default: 'latest'
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
docker-build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,15 +49,13 @@ jobs:
env:
DOCKER_CLI_HINTS: false
DOCKER_EXTRA: --platform=linux/amd64,linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: hardcoreeng
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
VERSION: ${{ inputs.version }}

- name: Publish base image
env:
DOCKER_CLI_HINTS: false
DOCKER_EXTRA: --platform=linux/amd64,linux/arm64
VERSION: ${{ inputs.version }}
run: |
echo Pushing base image
cd ./dev/base-image
Expand Down
11 changes: 7 additions & 4 deletions dev/base-image/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash

docker build -t hardcoreeng/base -f base.Dockerfile ${DOCKER_EXTRA} .
docker build -t hardcoreeng/rekoni-base -f rekoni.Dockerfile ${DOCKER_EXTRA} .
docker build -t hardcoreeng/print-base -f print.Dockerfile ${DOCKER_EXTRA} .
docker build -t hardcoreeng/front-base -f front.Dockerfile ${DOCKER_EXTRA} .
# Default version if not set
VERSION=${VERSION:-"latest"}

docker build -t hardcoreeng/base:${VERSION} -f base.Dockerfile ${DOCKER_EXTRA} .
docker build -t hardcoreeng/rekoni-base:${VERSION} -f rekoni.Dockerfile ${DOCKER_EXTRA} .
docker build -t hardcoreeng/print-base:${VERSION} -f print.Dockerfile ${DOCKER_EXTRA} .
docker build -t hardcoreeng/front-base:${VERSION} -f front.Dockerfile ${DOCKER_EXTRA} .

0 comments on commit 78326a8

Please sign in to comment.