Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployment config #27

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Slovensko.Digital CI

on:
push:
branches: '**'

jobs:
gitlab-push:
if: ${{github.ref == 'refs/heads/master'}}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: dokku/github-action@master
with:
git_push_flags: '--force'
git_remote_url: ssh://git@${{secrets.GITLAB_DEPLOY_HOST}}/${{github.event.repository.name}}.git
ssh_private_key: ${{secrets.GITLAB_DEPLOY_KEY}}
44 changes: 44 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
image: alpine:latest

variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 0
AUTO_DEVOPS_BUILD_CACHE: registry
AUTO_DEPLOY_IMAGE_VERSION: 'v2.47.0'

stages:
- build
- deploy

include:
- template: Jobs/Build.gitlab-ci.yml

production:
extends: .auto-deploy
stage: deploy
script:
- auto-deploy check_kube_domain
- auto-deploy download_chart
- auto-deploy use_kube_context || true
- auto-deploy ensure_namespace
- auto-deploy create_secret
- auto-deploy deploy
- auto-deploy persist_environment_url
environment:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
artifacts:
paths: [environment_url.txt]
when: always
allow_failure: false
rules:
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
when: never
- when: on_success

# The latest build job generates a dotenv report artifact with a CI_APPLICATION_TAG
# that also includes the image digest. This configures Auto Deploy to receive
# this artifact and use the updated CI_APPLICATION_TAG for deployments.
.auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"
dependencies: [build]
22 changes: 22 additions & 0 deletions .gitlab/auto-deploy-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
timeout: 120
service:
externalPort: 5000
internalPort: 80
image:
secrets:
- name: skdigital-bonet-registry
livenessProbe:
path: "/"
initialDelaySeconds: 10
timeoutSeconds: 10
scheme: "HTTP"
probeType: "httpGet"
httpHeaders: []
readinessProbe:
initialDelaySeconds: 10
probeType: "exec"
command:
- "true"
resources:
requests:
memory: 64Mi