forked from Hashnode/starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (63 loc) · 2.02 KB
/
prod-build-deploy-on-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Prod - Build and Deploy on release
on:
release:
types: [published]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: mdb-dev
env:
AWS_REGION: us-east-2
steps:
- name: Generate token
# Use the Github App private key to request an installation
# token with read-only access to the organization's private
# repositories. This token is then used in the checkout step
# (but not in subsequent steps that create releases and upload
# assets, those still use the default token that has write
# access to the current repository).
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.ACTION_APP_ID }}
private_key: ${{ secrets.ACTION_APP_KEY }}
- name: Checkout tag
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Pull MindsDB Github Actions
uses: actions/checkout@v4
with:
repository: mindsdb/github-actions
path: github-actions
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }}
- uses: ./github-actions/setup-env
- uses: ./github-actions/build-push-ecr
with:
module-name: ${{ env.CI_REPOSITORY_SLUG }}
build-for-environment: production
image-ref: ${{ env.CI_REF_SLUG }}
deploy-prod:
runs-on: mdb-prod
needs: [build]
environment:
name: prod
url: https://mindsdb.com/blog
steps:
- uses: actions/checkout@v4
- name: Pull MindsDB Github Actions
uses: actions/checkout@v4
with:
repository: mindsdb/github-actions
path: github-actions
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }}
- uses: ./github-actions/setup-env
- uses: DevOps-Nirvana/aws-helm-multi-deploy-nodocker@v2
with:
environment-slug: prod
k8s-namespace: prod
image-tag: production-${{ env.CI_REF_SLUG }}
timeout: 600s