Skip to content

increace time for server start #38

increace time for server start

increace time for server start #38

Workflow file for this run

name: Deploy develop
on:
push:
branches:
- develop
workflow_dispatch:
env:
APP_NAME: hibon-service
PROJECT_NAME: dev-hibon-service
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install PM2 globally
run: npm install pm2 -g
- name: Install Dependencies
run: npm install
- name: Run Jest Tests
run: npm test
deploy:
needs: test
name: Build Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: hibon-service
IMAGE_TAG: ${{ github.sha }}
run: |
docker build --build-arg GITBOT_TOKEN=${{ secrets.GITBOT_TOKEN }} -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY
- name: Update kube config
run: |
aws eks update-kubeconfig --name eks --region ${{ secrets.AWS_DEFAULT_REGION }}
- name: Deploy to EKS
run: |
kubectl delete deploy $PROJECT_NAME || echo "old deploy deleted"
kubectl apply -f k8s/dev_deployment.yml