Skip to content

(some message stating you added .idea to ignored entries) #5

(some message stating you added .idea to ignored entries)

(some message stating you added .idea to ignored entries) #5

Workflow file for this run

name: Release CCDScan Backend
on:
push:
tags:
- ccdscan-backend/*
jobs:
release-docker:
runs-on: ubuntu-latest
environment: release
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: 'concordium'
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set image tag if correctly formatted
env:
TAG: ${{ github.ref_name }}
run: |
TAG_VERSION=${TAG##ccdscan-backend/}
EXPECTED=$(yq .package.version backend-rust/Cargo.toml)
EXTRACTED="$TAG_VERSION"
if [ ! "$EXPECTED" = "$EXTRACTED" ] ; then
echo "::error::$EXPECTED does not match $EXTRACTED."
exit 1
fi
echo "TAG_VERSION=${TAG_VERSION}" >> $GITHUB_ENV
- name: Check if images exists
run: |
set +e
docker manifest inspect concordium/ccdscan-indexer:$TAG_VERSION
EXITCODE=$?
if [ $EXITCODE -eq "0" ]; then
echo "::error::concordium/ccdscan-indexer:$TAG_VERSION already exists."
exit 1
fi
docker manifest inspect concordium/ccdscan-api:$TAG_VERSION
EXITCODE=$?
if [ $EXITCODE -eq "0" ]; then
echo "::error::concordium/ccdscan-api:$TAG_VERSION already exists."
exit 1
fi
- name: Build indexer docker image
uses: docker/build-push-action@v6
with:
context: backend-rust
file: backend-rust/Dockerfile
tags: concordium/ccdscan-indexer:${{ env.TAG_VERSION }}
push: true
build-args: |
target_binary=ccdscan-indexer
- name: Build api docker image
uses: docker/build-push-action@v6
with:
context: backend-rust
file: backend-rust/Dockerfile
tags: concordium/ccdscan-api:${{ env.TAG_VERSION }}
push: true
build-args: |
target_binary=ccdscan-api