Skip to content

ci: Automated update vc-module-marketplace-vendor #1100

ci: Automated update vc-module-marketplace-vendor

ci: Automated update vc-module-marketplace-vendor #1100

name: Cloud platform deployment
on:
workflow_dispatch:
push:
paths:
- 'backend/**'
branches:
- 'vcmp-*'
jobs:
gitops-publish-platform:
runs-on: ubuntu-22.04
env:
DOCKER_LOGIN: vcmp-token
DOCKER_PASSWORD: ${{ secrets.VCMP_ACR_DOCKER_PASSWORD }}
DOCKERFILE_PATH: ./backend
CONTAINER_REGISTRY: virtopaasregistrymain.azurecr.io
IMAGE_REPOSITORY: virtopaasregistrymain.azurecr.io/vcmp/platform
PLATFORM_IMAGE_NAME: vcmp-platform
ARGO_TOKEN: ${{ secrets.VCMP_TOKEN }}
ARGO_APP_NAME: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Install vc-build
run: |
dotnet tool install --global VirtoCommerce.GlobalTool
- name: Pack
shell: bash {0}
run: |
vc-build InstallModules -PackageManifestPath ./backend/packages.json -ProbingPath ./backend/platform/app_data/modules -DiscoveryPath ./backend/platform/modules --root ./backend/platform -SkipDependencySolving
- name: Get platfrom version
id: platform-version
run: |
echo "PLATFORM_IMAGE=$(cat ./backend/packages.json | jq -r '.PlatformImage')" >> $GITHUB_ENV
echo "PLATFORM_TAG=$(cat ./backend/packages.json | jq -r '.PlatformImageTag')" >> $GITHUB_ENV
- name: Set outputs
id: vars
run: echo "::set-output name=paas_tag::${{ env.PLATFORM_TAG }}-$(git rev-parse --short HEAD)"
- name: Build platform Image
run: |
docker build --build-arg PLATFORM_IMAGE=${{ env.PLATFORM_IMAGE }} --build-arg PLATFORM_TAG=${{ env.PLATFORM_TAG }} -t ${{env.PLATFORM_IMAGE_NAME}} ${{env.DOCKERFILE_PATH}}
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ env.DOCKER_LOGIN }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Publish platform image to the Virto Cloud
run: |
docker tag ${{env.PLATFORM_IMAGE_NAME}} ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG }}
docker push ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG }}
env:
TAG: ${{ steps.vars.outputs.paas_tag }}
- name: Az config
run: |
az config set extension.use_dynamic_install=yes_without_prompt
- name: Update app
run: |
vc-build CloudEnvSetParameter -EnvironmentName ${{ env.ARGO_APP_NAME }} -CloudToken ${{ secrets.VCMP_PLATFORM_TOKEN }} -HelmParameters platform.image.tag=$TAG
env:
TAG: ${{ steps.vars.outputs.paas_tag }}