From a944a561c74ed42ada4d0df559b61fc64e538f6e Mon Sep 17 00:00:00 2001 From: folland87 Date: Tue, 22 Oct 2024 16:55:41 +0200 Subject: [PATCH] test deployment --- .github/actions/k8s-deploy/action.yml | 7 +++++++ .github/workflows/deploy.yml | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/actions/k8s-deploy/action.yml b/.github/actions/k8s-deploy/action.yml index 48bd404..79d3dd6 100644 --- a/.github/actions/k8s-deploy/action.yml +++ b/.github/actions/k8s-deploy/action.yml @@ -70,6 +70,7 @@ runs: - name: Build and push Docker image shell: bash run: | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login -u "${{ github.actor }}" --password-stdin docker build -t ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} . docker push ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} @@ -84,6 +85,12 @@ runs: name: ${{ env.REPO_NAME }} spec: replicas: ${{ inputs.replicas }} + revisionHistoryLimit: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: ${{ env.REPO_NAME }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 71e6794..7cb5b16 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,14 +14,21 @@ jobs: uses: ./.github/actions/k8s-deploy with: app_port: 3000 - replicas: 2 + replicas: 1 cpu_request: 100m cpu_limit: 200m memory_request: 128Mi memory_limit: 256Mi - kube_config: ${{ secrets.KUBECONFIG }} - docker_username: ${{ secrets.DOCKER_USERNAME }} - docker_password: ${{ secrets.DOCKER_PASSWORD }} - env_secrets: ${{ secrets.MAIN_ENV_SECRETS }} + kube_config: ${{ secrets.KUBE_CONFIG_DOAD_STAGING }} + # env_secrets: ${{ secrets.MAIN_ENV_SECRETS }} - name: Get deployment URL run: echo "Deployed to ${{ steps.deploy.outputs.deployment_url }}" + + - name: 📢 Notify in mattermost channel + if: always() + uses: dataesr/mm-notifier-action@v1.0.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN}} + mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} + mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}} + deployment_url: ${{ steps.deploy.outputs.deployment_url }}