Change environment #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- ekw/SRE-1010/migrate-release-flow-gha | |
tags: | |
- verifiable-sc/* | |
env: | |
SERVICE_NAME: 'verifiable-sc' | |
SOURCE_IMAGE_TAG: 'rust:1.75.0' | |
jobs: | |
release-docker: | |
runs-on: ubuntu-latest | |
environment: front-end-tools | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
submodules: recursive | |
- name: Set image tag if correctly formatted | |
env: | |
TAG: ${{ github.ref_name }} | |
run: | | |
SERVICE_TAG=${TAG##${{ env.SERVICE_NAME }}/} | |
IFS='-' read -r ENVIRONMENT TAG_VERSION <<< "$SERVICE_TAG" | |
echo "FULL_IMAGE_TAG=concordium/${{ env.SERVICE_NAME }}-${TAG_VERSION}" >> $GITHUB_ENV | |
echo "ENVIRONMENT=$ENVIRONMENT" >> $GITHUB_ENV | |
- name: Check if image exist | |
run: | | |
set +e | |
docker manifest inspect ${{ env.FULL_IMAGE_TAG }} | |
EXITCODE=$? | |
if [ $EXITCODE -eq "0" ]; then | |
echo "Error: ${{ env.FULL_IMAGE_TAG }} already exist" | |
exit 1 | |
fi | |
- name: Build and push docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./reproducible | |
file: ./reproducible/build.Dockerfile | |
tags: ${{ env.FULL_IMAGE_TAG }} | |
no-cache: true | |
push: false | |
build-args: | | |
source_image=${{ env.SOURCE_IMAGE_TAG }} | |