Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .github/workflows/docker-build-push-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,22 @@ on:
paths:
- cmd/api/main.go
- .github/workflows/docker-build-push-api.yml
delete:

permissions:
contents: write

jobs:
build-and-push:
if: github.event_name == 'push'
uses: ./.github/workflows/reusable-docker-build-push.yml
with:
image_description: GitOps Example API
secrets: inherit

update-prod-tag:
if: github.event_name == 'push' && github.ref_name == 'main'
if: github.ref_name == 'main'
needs: build-and-push
uses: ./.github/workflows/reusable-update-prod-tag.yml
with:
image_name_pattern: amertz08\/gitops-example$
commit_message_label: api
secrets: inherit

register-branch:
if: github.event_name == 'push' && github.ref_name != 'main'
needs: build-and-push
uses: ./.github/workflows/reusable-argocd-register.yml
secrets: inherit

cleanup-branch:
if: github.event_name == 'delete' && github.event.ref_type == 'branch'
uses: ./.github/workflows/reusable-argocd-cleanup.yml
secrets: inherit
29 changes: 0 additions & 29 deletions .github/workflows/reusable-argocd-cleanup.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/reusable-argocd-register.yml

This file was deleted.

52 changes: 38 additions & 14 deletions deploy/argocd/branch-applicationset.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
kind: ApplicationSet
metadata:
name: gitops-example-branches
name: gitops-example-branch-previews
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/Amertz08/gitops-example
targetRevision: main
path: deploy/argocd/branches
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
generators:
- pullRequest:
github:
owner: Amertz08
repo: gitops-example
tokenRef:
secretName: github-token
key: token
requeueAfterSeconds: 60
template:
metadata:
name: "gitops-example-pr-{{number}}"
spec:
project: default
source:
repoURL: https://github.com/Amertz08/gitops-example
targetRevision: "{{branch}}"
path: deploy/base
kustomize:
images:
- "amertz08/gitops-example:{{branch_slug}}-latest"
destination:
server: https://kubernetes.default.svc
namespace: "gitops-example-pr-{{number}}"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 3
backoff:
duration: 10s
factor: 2
maxDuration: 3m
Empty file removed deploy/argocd/branches/.gitkeep
Empty file.
Loading