Consturct DB URL from parts in ENV passed to the container #16
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
name: CI build of all containers | |
on: | |
- push | |
- pull_request | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build hinfo image | |
run: | | |
docker build . \ | |
-f Dockerfile.hinfo \ | |
--tag consdb-hinfo \ | |
--label "runnumber=${GITHUB_RUN_ID}" | |
- name: Log in to GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Push image | |
run: | | |
ID=ghcr.io/${{ github.repository_owner }}/consdb-hinfo | |
if [[ "${{ github.ref }}" == "refs/pull/"* ]]; then | |
VERSION=$(echo "${{ github.head_ref }}" | sed -e 's|.*/||') | |
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then | |
VERSION=$(echo "${{ github.ref_name }}" | sed -e 's|^v||') | |
else | |
VERSION=latest | |
fi | |
docker tag consdb-hinfo $ID:$VERSION | |
docker push $ID:$VERSION |