This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VDS-1275: Storefront automate deployment (#65)
* VDS-1275: Storefront automate deployment * VDS-1275: Fix Invoke VC image deployment workflow condition
- Loading branch information
Showing
3 changed files
with
47 additions
and
39 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
# v0.1 | ||
# v0.2 | ||
|
||
name: VC image deployment | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
baseImageName: | ||
description: 'Base kustomize image name' | ||
required: true | ||
imageName: | ||
description: 'Deploying image name' | ||
required: true | ||
artifactVersion: | ||
description: 'Full artifact build number' | ||
artifactLink: | ||
description: 'Full link to artifact docker image' | ||
required: true | ||
appDescriptionRepo: | ||
description: 'ArgoCd repository' | ||
|
@@ -21,7 +19,6 @@ on: | |
required: true | ||
default: 'dev' | ||
|
||
|
||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
|
@@ -46,18 +43,19 @@ jobs: | |
- name: Update kustomize | ||
shell: pwsh | ||
run: | | ||
$REPOSITORY = "docker.pkg.github.com/$('${{ github.repository }}'.ToLower())" | ||
cd ${{ github.workspace }} | ||
cd ./webstore-app/resources | ||
kustomize edit set image ${{ github.event.inputs.baseImageName }}=$REPOSITORY/${{ github.event.inputs.imageName }}:${{ github.event.inputs.artifactVersion }} | ||
kustomize edit set image ${{ github.event.inputs.baseImageName }}=${{ github.event.inputs.artifactLink }} | ||
- uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master | ||
with: | ||
githubToken: ${{ secrets.REPO_TOKEN }} | ||
|
||
- name: Commit kustomize change | ||
shell: pwsh | ||
run: | | ||
if(git status --porcelain |Where {$_ -notmatch '^\?\?'}) # uncommitted changes exist | ||
{ | ||
git config --global user.name 'vc-ci' | ||
git config user.email --global '[email protected]' | ||
git commit -am 'Automated update ${{ github.repository }} to ${{ github.event.inputs.artifactVersion }}' | ||
git push | ||
} | ||
|
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