Skip to content

Apply

Apply #52

Workflow file for this run

name: Apply
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/apply.yml
- 'manifests/**'
pull_request:
branches:
- main
paths:
- .github/workflows/apply.yml
- 'manifests/**'
jobs:
apply:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./manifests
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
aws-region: ${{ vars.AWS_REGION }}
- name: Update kubeconfig
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'workflow_dispatch'
run: aws eks update-kubeconfig --name ${{ vars.AWS_EKS_CLUSTER_NAME }} --region ${{ vars.AWS_REGION }}
- name: Deploy to EKS
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'workflow_dispatch'
run: |
kubectl apply -f orders
kubectl apply -f payments
kubectl apply -f stock
- name: Recreate
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'workflow_dispatch'
run: |
kubectl rollout restart deployment -n orders orders-deployment
kubectl rollout restart deployment -n payments payments-deployment
kubectl rollout restart deployment -n stock stock-deployment