Skip to content

Update image.json

Update image.json #338

name: Cloud storefront deployment
on:
workflow_dispatch:
push:
paths:
- 'storefront/**'
branches:
- 'vcst-*'
jobs:
gitops:
runs-on: ubuntu-latest
env:
DOCKER_LOGIN: vcst-token
DOCKER_PASSWORD: ${{ secrets.VCST_ACR_DOCKER_PASSWORD }}
CONTAINER_REGISTRY: virtopaasregistrymain.azurecr.io
IMAGE_REPOSITORY: virtopaasregistrymain.azurecr.io/vcst/storefront
ARGO_APP_NAME: ${{ github.ref_name }}
STOREFRONT_REPO: ''
STOREFRONT_TAG: ''
steps:
- uses: actions/checkout@v4
- name: Install vc-build
run: |
dotnet tool install --global VirtoCommerce.GlobalTool
- name: Get storefront version
id: storefront-version
run: |
echo "STOREFRONT_TAG=$(cat ./storefront/image.json | jq -r '.Tag')" >> $GITHUB_ENV
echo "STOREFRONT_REPO=$(cat ./storefront/image.json | jq -r '.Repository')" >> $GITHUB_ENV
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ env.DOCKER_LOGIN }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Publish storefront image to the Virto Cloud
run: |
docker pull ${{ env.STOREFRONT_REPO }}:${{ env.STOREFRONT_TAG }}
docker tag ${{ env.STOREFRONT_REPO }}:${{ env.STOREFRONT_TAG }} ${{ env.IMAGE_REPOSITORY }}:${{ env.STOREFRONT_TAG }}
docker push ${{ env.IMAGE_REPOSITORY }}:${{ env.STOREFRONT_TAG }}
- name: Update app
run: |
vc-build CloudEnvSetParameter -EnvironmentName ${{ env.ARGO_APP_NAME }} -CloudToken ${{ secrets.VCST_PLATFORM_TOKEN }} -HelmParameters storefront.image.tag=$TAG
env:
TAG: ${{ env.STOREFRONT_TAG }}