Skip to content

Use correct variable #15

Use correct variable

Use correct variable #15

Workflow file for this run

on:
push:
tags:
- release/*
branches:
- ekw/SRE-1004/*
jobs:
release-base-image:
if: ${{ contains(github.ref_name, 'base-image') }}
runs-on: ubuntu-latest
environment: release
env:
IMAGE_NAME: "concordium/base"
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN}}
RUST_VERSION: "1.73.0"
GHC_VERSION: "9.6.4"
steps:
- name: Get the Image tag
env:
TAG: ${{ github.ref_name }}
run: echo "IMAGE_TAG=${TAG##ekw/SRE-1004/release-*}" #run: echo "IMAGE_TAG=${TAG##release/base-image-*}" >> $GITHUB_ENV
- name: Check if image exist
run: |
set +e
docker manifest inspect ${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}
exitcode=$?
if [ $exitcode -eq "0" ]; then
echo "Error: ${{env.IMAGE_NAME}}:rust${{env.RUST_VERSION}}-ghc${{env.GHC_VERSION}} already exist"
exit 1
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Clone repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: build docker image
run: |
docker build --build-arg rust_version="${{env.RUST_VERSION}}" --build-arg ghc_version="${{env.GHC_VERSION}}" --label rust_version="${{env.RUST_VERSION}}" --label ghc_version="${{env.GHC_VERSION}}" -f "docker/base.Dockerfile" -t "${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}" .
- name: Push docker image
run: |
echo ${{env.IMAGE_TAG}}
# docker push ${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}