Update packages.json #7419
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cloud platform deployment | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'backend/**' | |
branches: [ virtostart ] | |
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 | |
- 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_OUTPUT | |
- name: Build and Publish Docker Image to Virto container registry | |
run: | | |
vc-build BuildAndPush -DockerUsername $DOCKER_LOGIN -DockerPassword $DOCKER_PASSWORD -DockerfilePath $DOCKERFILE_PATH -DockerImageName $IMAGE_REPOSITORY -DockerImageTag $TAG -DockerRegistryUrl $CONTAINER_REGISTRY | |
env: | |
DOCKER_LOGIN: virtostart | |
DOCKER_PASSWORD: ${{ secrets.VIRTOSTART_ACR_DOCKER_PASSWORD }} | |
DOCKERFILE_PATH: ./backend/Dockerfile | |
CONTAINER_REGISTRY: virtopaasregistrymain.azurecr.io | |
IMAGE_REPOSITORY: virtopaasregistrymain.azurecr.io/virtostart/platform | |
TAG: ${{ env.PLATFORM_VERSION }}-${{ steps.vars.outputs.sha_short }} | |
- name: Rename docker image | |
run: | | |
docker images | |
docker tag $IMAGE_REPOSITORY:$TAG $GH_CONTAINER_REPOSITORY:$TAG | |
env: | |
IMAGE_REPOSITORY: virtopaasregistrymain.azurecr.io/virtostart/platform | |
TAG: ${{ env.PLATFORM_VERSION }}-${{ steps.vars.outputs.sha_short }} | |
GH_CONTAINER_REPOSITORY: 'ghcr.io/virtocommerce/virtostart' | |
- name: Login to GH Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: 'ghcr.io' | |
username: $GITHUB_ACTOR | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish Docker Image to GH Registry | |
uses: VirtoCommerce/vc-github-actions/publish-docker-image@master | |
with: | |
image: 'ghcr.io/virtocommerce/virtostart' | |
tag: ${{ env.PLATFORM_VERSION }}-${{ steps.vars.outputs.sha_short }} | |
docker_user: $GITHUB_ACTOR | |
docker_token: ${{ secrets.GITHUB_TOKEN }} | |
docker_hub: 'false' | |
update_latest: 'true' | |
release_branch: virtostart | |
- name: Update app | |
run: | | |
vc-build CloudEnvSetParameter -EnvironmentName virtostart-main -CloudToken ${{ secrets.VIRTOSTART_PLATFORM_TOKEN }} -HelmParameters platform.image.tag=$TAG | |
env: | |
TAG: ${{ env.PLATFORM_VERSION }}-${{ steps.vars.outputs.sha_short }} |