Skip to content

Commit

Permalink
test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Oct 22, 2024
1 parent 2dab081 commit a944a56
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/actions/k8s-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit a944a56

Please sign in to comment.