Skip to content

Commit

Permalink
Merge pull request #5 from BobJWalker/feature/triggers
Browse files Browse the repository at this point in the history
Feature/triggers
  • Loading branch information
BobJWalker authored Feb 9, 2024
2 parents df7b8c3 + b63e57a commit 8557f6d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
29 changes: 8 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,6 @@ jobs:
tag_name: ${{ steps.determine_version.outputs.semVer }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: EnvOverlay
name: Set Release Number
run: |
$branchName = (((${env:GITHUB_REF} -replace "refs/heads/", "") -replace "feature/", "") -replace "bugfix/", "") -replace " ", ""
Write-Host "The Branch Name is: $branchName"
$environmentName = "test"
Write-Host "The environment name is now $environmentName"

if ($branchName -ne "main")
{
Write-Host "The branch is not the main branch, using the feature branch settings instead."

$environmentName = "dev"
}

Write-Host "Setting the Output Variable KUSTOMIZE_ENVIRONMENT to $environmentName"
Write-Output "KUSTOMIZE_ENVIRONMENT=$environmentName" >> $Env:GITHUB_OUTPUT
shell: pwsh
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -75,8 +56,14 @@ jobs:
- name: update dev kustomize
uses: mikefarah/yq@master
with:
cmd: yq -i '.images.[0].newTag = "${{ steps.determine_version.outputs.semVer }}"' 'k8s/overlays/${{ steps.EnvOverlay.outputs.KUSTOMIZE_ENVIRONMENT }}/kustomization.yaml'
- name: commit the kustomize change
cmd: yq -i '.images.[0].newTag = "${{ steps.determine_version.outputs.semVer }}"' 'k8s/overlays/dev/kustomization.yaml'
if: contains(github.ref, 'feature')
- name: update test kustomize
uses: mikefarah/yq@master
with:
cmd: yq -i '.images.[0].newTag = "${{ steps.determine_version.outputs.semVer }}"' 'k8s/overlays/test/kustomization.yaml'
if: github.ref == 'refs/heads/master'
- name: commit the kustomize change for Argo
uses: devops-infra/action-commit-push@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/deploy-dev-argo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ on:
jobs:
update-argo-tag:
runs-on: ubuntu-latest
steps:
- name: update tag
uses: richardsimko/update-tag@v1
with:
tag_name: dev-argo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "dev-argo"
tag_exists_error: false
force_push_tag: true
2 changes: 1 addition & 1 deletion k8s/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ secretGenerator:
images:
- name: bobjwalker99/randomquotes-k8s
newName: bobjwalker99/randomquotes-k8s
newTag: "0.1.49-tagging.22"
newTag: "0.1.51-triggers.4"
patches:
- target:
kind: Ingress
Expand Down

0 comments on commit 8557f6d

Please sign in to comment.