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.
Merge branch 'release/1.5.0' into master
- Loading branch information
Showing
7 changed files
with
135 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# v0.1 | ||
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' | ||
required: true | ||
appDescriptionRepo: | ||
description: 'ArgoCd repository' | ||
required: true | ||
default: 'VirtoCommerce/vc-deploy-apps' | ||
appDescriptionBranch: | ||
description: 'ArgoCd branch' | ||
required: true | ||
default: 'master' | ||
|
||
|
||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Start deployment | ||
uses: bobheadxi/deployments@master | ||
id: deployment | ||
with: | ||
step: start | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
env: Development | ||
no_override: false | ||
|
||
- name: Checkout ArgoCD repository | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.REPO_TOKEN }} | ||
repository: "${{ github.event.inputs.appDescriptionRepo }}" | ||
ref: "${{ github.event.inputs.appDescriptionBranch }}" | ||
|
||
- name: Update kustomize | ||
shell: pwsh | ||
run: | | ||
$REPOSITORY = "docker.pkg.github.com/$('${{ github.repository }}'.ToLower())" | ||
cd ${{ github.workspace }} | ||
cd ./webstore-app/overlays/dev | ||
kustomize edit set image ${{ github.event.inputs.baseImageName }}=$REPOSITORY/${{ github.event.inputs.imageName }}:${{ github.event.inputs.artifactVersion }} | ||
- name: Commit kustomize change | ||
shell: pwsh | ||
run: | | ||
if(git status --porcelain |Where {$_ -notmatch '^\?\?'}) # uncommitted changes exist | ||
{ | ||
git config --global user.name 'GitHub Actions' | ||
git config user.email --global '[email protected]' | ||
git commit -am 'Automated update ${{ github.repository }} to ${{ github.event.inputs.artifactVersion }}' | ||
git push | ||
} | ||
else | ||
{ | ||
Write-Output 'Nothing to commit, working tree clean' | ||
} | ||
- name: Wait for environment is up | ||
shell: pwsh | ||
timeout-minutes: 5 | ||
run: | | ||
do { | ||
Start-Sleep -s 15 | ||
$statusBage = (Invoke-WebRequest -Uri "https://cd.govirto.com/api/badge?name=webstore-app-dev").Content | ||
$syncedAndHealthy = $statusBage.Contains('>Healthy<') -and $statusBage.Contains('>Synced<') | ||
if (-not $syncedAndHealthy) { | ||
Write-Host "Sync pending..." | ||
} | ||
} | ||
while (-not $syncedAndHealthy) | ||
- name: BUILD_STATE::successful | ||
if: success() | ||
run: echo "BUILD_STATE=successful" >> $GITHUB_ENV | ||
|
||
- name: BUILD_STATE::failed | ||
if: failure() | ||
run: echo "BUILD_STATE=failed" >> $GITHUB_ENV | ||
|
||
- name: Update GitHub deployment status | ||
uses: bobheadxi/deployments@master | ||
if: always() | ||
with: | ||
step: finish | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
status: ${{ job.status }} | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |
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
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
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