Skip to content

Commit

Permalink
Slack for staging CD (#109)
Browse files Browse the repository at this point in the history
* staging

* slack CD

* changes
  • Loading branch information
anishfyle authored May 24, 2023
1 parent 85fe99b commit 7e43f86
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/deployment/staging/controller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
apiVersion: v1
kind: Service
metadata:
name: slack-app
namespace: integrations
labels:
app: slack-app
spec:
type: ClusterIP
ports:
- port: 8000
selector:
app: slack-app
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: slack-app
namespace: integrations
labels:
app: slack-app
spec:
replicas: 1
selector:
matchLabels:
app: slack-app
strategy:
type: RollingUpdateing
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels:
app: slack-app
spec:
containers:
- name: slack-app
image: docker.io/{{DOCKERHUB_USERNAME}}/fyle_slack-app:{{RELEASE_VERSION}}
resources:
limits:
memory: 200Mi
requests:
memory: 200Mi
ports:
- containerPort: 8000
readinessProbe:
httpGet:
path: /ready
port: 8000
initialDelaySeconds: 10
timeoutSeconds: 1
envFrom:
- secretRef:
name: slack-app-secrets
terminationGracePeriodSeconds: 60
imagePullSecrets:
- name: myregistrykey2
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: slack-app-qcluster
namespace: integrations
labels:
app: slack-app-qcluster
spec:
replicas: 1
selector:
matchLabels:
app: slack-app-qcluster
template:
metadata:
labels:
app: slack-app-qcluster
spec:
containers:
- name: slack-app
image: docker.io/{{DOCKERHUB_USERNAME}}/fyle_slack-app:{{RELEASE_VERSION}}
resources:
limits:
memory: 400Mi
requests:
memory: 400Mi
command: [ 'bash', 'run_qcluster.sh' ]
envFrom:
- secretRef:
name: slack-app-secrets
terminationGracePeriodSeconds: 60
imagePullSecrets:
- name: myregistrykey2
48 changes: 48 additions & 0 deletions .github/workflows/staging_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Slack App

on:
push:
branches:
- master
pull_request:
types: [labeled]

jobs:
slack_app_deploy:
if: (github.event_name != 'pull_request') || (github.event_name == 'pull_request' && github.event.action == 'labeled')
runs-on: ubuntu-latest
environment: Staging
steps:
- uses: actions/checkout@v2
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
- name: push to dockerhub
uses: fylein/docker-release-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE_NAME: fyle_netsuite-api
- name: Deploy to Staging
uses: fylein/aws-eks-deploy-action@master
env:
EKS_CLUSTER_NAME: ${{ secrets.EKS_CLUSTER_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOCAL_HOST: ${{ secrets.LOCAL_HOST }}
LOCAL_PORT: ${{ secrets.LOCAL_PORT }}
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
EKS_KUBECTL_ROLE: ${{ secrets.EKS_KUBECTL_ROLE }}
ROLE_SESSION_NAME: ${{ secrets.ROLE_SESSION_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
KUBERNETES_MANIFEST_FILE_PATH: deployment/staging/controller.yml
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: Slack App Deploy Status - ${{ job.status }}
SLACK_TITLE: Deploy Slack App
SLACK_ICON_EMOJI: ":pepeok:"
SLACK_USERNAME: Slack_App
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_FOOTER: ''

0 comments on commit 7e43f86

Please sign in to comment.