Skip to content

Bootstrap Argo CD

Bootstrap Argo CD #22

name: "Bootstrap Argo CD"
on:
workflow_run:
workflows: ["Terraform Apply"]
types:
- completed
workflow_dispatch:
permissions: write-all
jobs:
argo_cd:
runs-on: ubuntu-latest
environment: prod
steps:
- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
version: 2 # default
verbose: false # default
arch: amd64 # allowed values: amd64, arm64
- name: verify aws profile
run: |
aws sts get-caller-identity
aws configure list
- name: install kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.29.0'
- name: configure kubectl
run: |
aws eks update-kubeconfig --name ${{ secrets.EKS_CLUSTER_NAME }} --region ${{ secrets.AWS_REGION }}
- name: verify argocd namespace
id: verify-argocd-namespace
run: echo "ns=$(kubectl get ns argocd -o=jsonpath="{.metadata.name}")" >> "$GITHUB_OUTPUT"
- name: install argocd
if: ${{ (steps.verify-argocd-namespace.outputs.ns != 'argocd') }}
run: |
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.9.3/manifests/install.yaml
- name: checkout code
uses: actions/checkout@v4
- name: install cluster app of apps
run: kubectl apply -f kubernetes/app-of-apps-cluster.yaml