Skip to content

Commit

Permalink
Add docker images tags release (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
goshander authored Oct 17, 2024
1 parent ad15ab4 commit 2f93a26
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/update-docker-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Update docker images

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}

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.US_VERSION }}
docker tag ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:${{ env.US_VERSION }} ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:release
docker push ${{ env.REGISTRY }}/${{ env.US_IMAGE_NAME }}:release

0 comments on commit 2f93a26

Please sign in to comment.