Skip to content

Commit

Permalink
refactor: more dry CI code
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Jan 11, 2025
1 parent afda625 commit 182834f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 94 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docker-production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy docker Production
name: Deploy docker production
'on':
push:
tags:
Expand All @@ -7,11 +7,16 @@ name: Deploy docker Production
workflow_dispatch: {}
jobs:
job:
name: Deploy docker Production
name: Deploy docker production
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Get version from tag
run: |
set -x
echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
id: version
- name: Docker login
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username darkwind8 --password-stdin
- name: Install Darklab ssh key
Expand All @@ -27,11 +32,6 @@ jobs:
chmod 600 ~/.ssh/*
ssh-keyscan -H 37.27.207.42 >> ~/.ssh/known_hosts | true
ssh-keyscan -H darkbot >> ~/.ssh/known_hosts | true
- name: Get version from tag
run: |
set -x
echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
id: version
- name: Build image darkwind8/darkbot
run: |
set -ex
Expand Down
18 changes: 13 additions & 5 deletions kcls/build.k
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import .wf_docker_staging
import .wf_docker_production
import .wg_test
import .wg_pages

import infra.kcls.common.workflow
import yaml

_image_name = "darkwind8/darkbot"

_workflows = [
wf_docker_staging._workflow
wf_docker_production._workflow
workflow.DockerDeploySwarm(workflow.DockerDeploySwarmOpts {
image_name = _image_name
service_name = "darkbot"
environment = "staging"
})
workflow.DockerDeploySwarm(workflow.DockerDeploySwarmOpts {
image_name = _image_name
service_name = "darkbot"
environment = "production"
})
wg_test._workflow
wg_pages._workflow
]
Expand Down
1 change: 0 additions & 1 deletion kcls/common.k

This file was deleted.

38 changes: 0 additions & 38 deletions kcls/wf_docker_production.k

This file was deleted.

41 changes: 0 additions & 41 deletions kcls/wf_docker_staging.k

This file was deleted.

2 changes: 0 additions & 2 deletions kcls/wg_pages.k
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import infra.kcls.models.github_workflow as gw
import infra.kcls.common.github as ghc
import infra.kcls.actions.install_go as go
import infra.kcls.actions.install_taskfile as tf
import infra.kcls.models.github_action as ga

_workflow_name = "Pages"
Expand Down

0 comments on commit 182834f

Please sign in to comment.