Skip to content

Add docker images tags release #1

Add docker images tags release

Add docker images tags release #1

name: Update docker images
on:
push:
branches:
- add-docker-tags-release
env:
REGISTRY: ghcr.io
GH_REGISTRY_LOGIN: robot-charts
UI_IMAGE_NAME: datalens-tech/datalens-ui
US_IMAGE_NAME: datalens-tech/datalens-us
jobs:
run:
name: Set release tags
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get last version config
run: |
VERSION_CONFIG=$(cat ./versions-config.json)
UI_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.uiVersion')
US_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.usVersion')
CONTROL_API_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.controlApiVersion')
DATA_API_VERSION=$(echo "${VERSION_CONFIG}" | jq -r '.dataApiVersion')
echo "UI_VERSION=$UI_VERSION" >> "$GITHUB_ENV"
echo "US_VERSION=$US_VERSION" >> "$GITHUB_ENV"
echo "CONTROL_API_VERSION=$CONTROL_API_VERSION" >> "$GITHUB_ENV"
echo "DATA_API_VERSION=$DATA_API_VERSION" >> "$GITHUB_ENV"
- name: Login to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.GH_REGISTRY_LOGIN }}
password: ${{ secrets.GH_REGISTRY_TOKEN }}
- name: Pull images and push with release tag
run: |
docker pull ${{ env.REGISTRY }}/${{ env.UI_IMAGE_NAME }}:${{ env.UI_VERSION }}
docker tag ${{ env.REGISTRY }}/${{ env.UI_IMAGE_NAME }}:${{ env.UI_VERSION }} ${{ env.REGISTRY }}/${{ env.UI_IMAGE_NAME }}:release
docker push ${{ env.REGISTRY }}/${{ env.UI_IMAGE_NAME }}:release
docker pull ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:${{ env.UI_VERSION }}
docker tag ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:${{ env.UI_VERSION }} ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:release
docker push ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:release