ArgoCD workflow #10
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
name: ArgoCD workflow | |
on: | |
workflow_run: | |
workflows: ["Terraform workflow"] | |
types: | |
- completed | |
push: | |
paths: | |
- 'argocd/**' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} | |
- name: Download Terraform Output Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: terraform-output | |
path: . | |
- name: Read Terraform Output | |
id: read_tf_output | |
run: | | |
export KUBECTL_CONFIG_COMMAND=$(cat eks_connect.txt) | |
echo "KUBECTL_CONFIG_COMMAND=$KUBECTL_CONFIG_COMMAND" >> $GITHUB_ENV | |
- name: Install kubectl | |
run: | | |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x kubectl | |
sudo mv kubectl /usr/local/bin/ | |
- name: Update kubeconfig | |
run: ${{ steps.read_tf_output.outputs.kubectl_config_command }} | |
- name: Deploy application | |
run: kubectl apply -f argocd/config/argocd-app.yaml | |