Skip to content

Docker images

Docker images #1322

Workflow file for this run

name: Docker images
on:
workflow_dispatch:
push:
tags:
- 'v*'
schedule:
- cron: '17 21 * * *'
jobs:
build_test_env:
name: Build sblauth/cashocs-test-env image
runs-on: ubuntu-latest
outputs:
TAG_PREFIX: ${{ steps.tag_name.outputs.TAG_PREFIX }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Get tag name
id: tag_name
run: |
if [[ ${GITHUB_REF#refs/tags/} == v* ]]
then
echo "TAG_PREFIX=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "TAG_PREFIX=latest" >> $GITHUB_OUTPUT
fi
- name: Log into the Dockerhub registry
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker buildx build --push \
--no-cache \
--cache-to=type=inline,mode=max --file ./.github/docker/Dockerfile \
--target=test-env \
--tag sblauth/cashocs-test-env:${{ steps.tag_name.outputs.TAG_PREFIX }} .
build_user_image:
name: Build sblauth/cashocs image
needs:
- build_test_env
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Log into the Dockerhub registry
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker buildx build --push \
--no-cache \
--cache-to=type=inline,mode=max --file ./.github/docker/Dockerfile \
--target=cashocs \
--tag sblauth/cashocs:${{ needs.build_test_env.outputs.TAG_PREFIX }} .