Skip to content

Commit 1c206d7

Browse files
committed
fix: add new ci
1 parent 168bf5b commit 1c206d7

File tree

6 files changed

+100
-108
lines changed

6 files changed

+100
-108
lines changed

.github/actions/build-push-ecr/action.yml

-50
This file was deleted.

.github/actions/setup-env/action.yml

-24
This file was deleted.

.github/workflows/dev-build-deploy-on-main.yaml

+43-16
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,67 @@ name: Dev - Build and Deploy on main
33
on:
44
push:
55
branches:
6-
- master
76
- main
87

98
defaults:
109
run:
1110
shell: bash
1211

13-
jobs:
1412

15-
build-hashnode-starter-kit:
16-
runs-on: [self-hosted, dev]
13+
jobs:
14+
build:
15+
runs-on: mdb-dev
16+
env:
17+
AWS_REGION: us-east-2
1718
steps:
18-
- uses: actions/checkout@v2
19+
- name: Generate token
20+
# Use the Github App private key to request an installation
21+
# token with read-only access to the organization's private
22+
# repositories. This token is then used in the checkout step
23+
# (but not in subsequent steps that create releases and upload
24+
# assets, those still use the default token that has write
25+
# access to the current repository).
26+
id: generate_token
27+
uses: tibdex/github-app-token@v1
28+
with:
29+
app_id: ${{ secrets.ACTION_APP_ID }}
30+
private_key: ${{ secrets.ACTION_APP_KEY }}
31+
- name: Checkout tag
32+
uses: actions/checkout@v4
1933
with:
20-
submodules: 'true'
21-
- uses: ./.github/actions/setup-env
22-
- uses: ./.github/actions/build-push-ecr
34+
submodules: recursive
35+
token: ${{ steps.generate_token.outputs.token }}
36+
- name: Pull MindsDB Github Actions
37+
uses: actions/checkout@v4
2338
with:
24-
module-name: ${{ env.CI_REPOSITORY_NAME_SLUG }}
25-
build-for-environment: dev
26-
# extra-build-args: "-f docker/mindsdb.Dockerfile"
39+
repository: mindsdb/github-actions
40+
path: github-actions
41+
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }}
42+
- uses: ./github-actions/setup-env
43+
- uses: ./github-actions/build-push-ecr
44+
with:
45+
module-name: ${{ env.CI_REPOSITORY_SLUG }}
46+
build-for-environment: development
47+
# extra-build-args: -f docker/Dockerfile
2748

2849
deploy:
29-
runs-on: [self-hosted, dev]
30-
needs: [build-hashnode-starter-kit]
50+
runs-on: mdb-dev
51+
needs: build
3152
environment:
3253
name: dev
3354
url: https://hashnode.dev.mindsdb.com/blog
3455
steps:
35-
- uses: actions/checkout@v2
36-
- uses: ./.github/actions/setup-env
56+
- uses: actions/checkout@v4
57+
- name: Pull MindsDB Github Actions
58+
uses: actions/checkout@v4
59+
with:
60+
repository: mindsdb/github-actions
61+
path: github-actions
62+
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }}
63+
- uses: ./github-actions/setup-env
3764
- uses: DevOps-Nirvana/aws-helm-multi-deploy-nodocker@v2
3865
with:
3966
environment-slug: dev
4067
k8s-namespace: dev
41-
image-tag: dev-${{ env.SLUG }}
68+
image-tag: development-${{ env.SLUG }}
4269
timeout: 600s

.github/workflows/prod-build-deploy-on-release.yaml

+46-15
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,69 @@ name: Prod - Build and Deploy on release
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
67

78
defaults:
89
run:
910
shell: bash
1011

12+
1113
jobs:
1214

13-
build-hashnode-starter-kit:
14-
runs-on: [self-hosted, dev]
15+
build:
16+
runs-on: mdb-dev
17+
env:
18+
AWS_REGION: us-east-2
1519
steps:
16-
- uses: actions/checkout@v2
20+
- name: Generate token
21+
# Use the Github App private key to request an installation
22+
# token with read-only access to the organization's private
23+
# repositories. This token is then used in the checkout step
24+
# (but not in subsequent steps that create releases and upload
25+
# assets, those still use the default token that has write
26+
# access to the current repository).
27+
id: generate_token
28+
uses: tibdex/github-app-token@v1
29+
with:
30+
app_id: ${{ secrets.ACTION_APP_ID }}
31+
private_key: ${{ secrets.ACTION_APP_KEY }}
32+
- name: Checkout tag
33+
uses: actions/checkout@v4
1734
with:
18-
submodules: 'true'
19-
- uses: ./.github/actions/setup-env
20-
- uses: ./.github/actions/build-push-ecr
35+
submodules: recursive
36+
token: ${{ steps.generate_token.outputs.token }}
37+
- name: Pull MindsDB Github Actions
38+
uses: actions/checkout@v4
2139
with:
22-
module-name: ${{ env.CI_REPOSITORY_NAME_SLUG }}
23-
build-for-environment: prod
24-
# extra-build-args: "-f docker/mindsdb.Dockerfile"
40+
repository: mindsdb/github-actions
41+
path: github-actions
42+
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }}
43+
- uses: ./github-actions/setup-env
44+
- uses: ./github-actions/build-push-ecr
45+
with:
46+
module-name: ${{ env.CI_REPOSITORY_SLUG }}
47+
build-for-environment: production
48+
extra-build-args: -f docker/Dockerfile
49+
image-ref: ${{ env.CI_REF_SLUG }}
2550

26-
deploy:
27-
runs-on: [self-hosted, prod]
28-
needs: [build-hashnode-starter-kit]
51+
deploy-prod:
52+
runs-on: mdb-prod
53+
needs: [build]
2954
environment:
3055
name: prod
3156
url: https://mindsdb.com/blog
3257
steps:
33-
- uses: actions/checkout@v2
34-
- uses: ./.github/actions/setup-env
58+
- uses: actions/checkout@v4
59+
- name: Pull MindsDB Github Actions
60+
uses: actions/checkout@v4
61+
with:
62+
repository: mindsdb/github-actions
63+
path: github-actions
64+
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }}
65+
- uses: ./github-actions/setup-env
3566
- uses: DevOps-Nirvana/aws-helm-multi-deploy-nodocker@v2
3667
with:
3768
environment-slug: prod
3869
k8s-namespace: prod
39-
image-tag: prod-${{ env.SLUG }}
70+
image-tag: production-${{ env.CI_REF_SLUG }}
4071
timeout: 600s

.gitignore

+10-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/out/
1616

1717
# production
18-
/build
18+
build/
1919

2020
# misc
2121
.DS_Store
@@ -41,6 +41,14 @@ next-env.d.ts
4141
.vscode/*
4242
!.vscode/extensions.json
4343

44-
# Kubernetes / DevOps Nirvana
44+
# PyCharm
45+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
46+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
47+
# and can be added to the global gitignore or merged into this file. For a more nuclear
48+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
49+
.idea/
50+
51+
# Kubernetes / Gitlab CI Automation / Helm
4552
requirements.lock
53+
deployment/*/deployment/*/charts
4654
deployment/*/charts

deployment/hashnode-starter-kit/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ deployment:
88

99
# Where the image comes from. This should be the ECR Repo / Gitlab Group / Repo Name
1010
image:
11-
repository: 454861456664.dkr.ecr.us-east-2.amazonaws.com/hashnode-starter-kit
11+
repository: 454861456664.dkr.ecr.us-east-2.amazonaws.com/mindsdb-hashnode-starter-kit
1212
# Uncomment these two temporarily (and disable probes below) to debug manually in Kubernetes
1313
# command: ["/bin/sh"]
1414
# args: ["-c", "while true; do echo hello; sleep 10;done"]

0 commit comments

Comments
 (0)