Skip to content

Update platform

Update platform #9596

name: vcpt-license
on:
workflow_dispatch:
push:
paths:
- 'backend/**'
branches: [ license ]
jobs:
gitops:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Az config
run: |
az config set extension.use_dynamic_install=yes_without_prompt
- name: Install vc-build
run: |
dotnet tool install --global VirtoCommerce.GlobalTool
- name: Pack
run: |
vc-build install -PackageManifestPath ./backend/packages.json -ProbingPath ./backend/platform/app_data/modules -DiscoveryPath ./backend/platform/modules --root ./backend/platform -SkipDependencySolving -GitHubToken ${{ secrets.PR_REPO_TOKEN }}
- name: Copy license.key
run: |
echo "$LIC_KEY" >> ./backend/platform/app_data/license.key
shell: bash
env:
LIC_KEY: ${{ secrets.LIC_KEY }}
- name: Get platfrom version
id: platform-version
run: |
echo "PLATFORM_VERSION=$(cat ./backend/packages.json | jq -r '.PlatformVersion')" >> $GITHUB_ENV
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build and Publish Docker Image
run: |
vc-build BuildAndPush -DockerUsername $DOCKER_LOGIN -DockerPassword $DOCKER_PASSWORD -DockerfilePath $DOCKERFILE_PATH -DockerImageName $IMAGE_REPOSITORY -DockerImageTag $TAG -DockerRegistryUrl $CONTAINER_REGISTRY
env:
DOCKER_LOGIN: vcpt-repo-saccess
DOCKER_PASSWORD: ${{ secrets.VCPT_ACR_DOCKER_PASSWORD }}
DOCKERFILE_PATH: ./backend/Dockerfile
CONTAINER_REGISTRY: virtopaasregistrymain.azurecr.io
IMAGE_REPOSITORY: virtopaasregistrymain.azurecr.io/vcpt/license
TAG: ${{ env.PLATFORM_VERSION }}-${{ env.sha_short }}
- name: Update app
run: |
vc-build CloudEnvSetParameter -CloudUrl https://portal.virtocommerce.cloud -EnvironmentName vcpt-license -CloudToken ${{ secrets.VCPT_PLATFORM_TOKEN }} -HelmParameters platform.image.tag=$TAG
env:
TAG: ${{ env.PLATFORM_VERSION }}-${{ env.sha_short }}