-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (52 loc) · 1.75 KB
/
deploy.yml
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
name: App Image Build And Deploy
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: environment to choice
options:
- testnet
- mainnet
env:
AWS_REGION: "ap-southeast-1"
app: dapplink-docs
permissions:
id-token: write
contents: read
run-name: Build Image For Repo
jobs:
build:
runs-on: self-hosted
outputs:
commit_sha: ${{ steps.get-commit-sha.outputs.commit_sha }}
ecr_registry: ${{ steps.login-ecr.outputs.registry }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Get Commit Sha
id: get-commit-sha
run: |
echo "::set-output name=commit_sha::$(git rev-parse --short=7 HEAD)"
- name: deploy app
run: |
registry="hkccr.ccs.tencentyun.com"
namespace="dapplink"
appname="dapplink-docs"
tag_name="${registry}/${namespace}/${appname}"
docker login --username=100003588471 -p dapplink@go hkccr.ccs.tencentyun.com
docker build --pull -t ${tag_name}:v3 .
docker push ${tag_name}:v3
HELM_OPTS="${HELM_OPTS} --set image.repository=${tag_name}"
HELM_OPTS="${HELM_OPTS} --set image.tag=v3"
if [ ${{github.event.inputs.environment }} == "testnet" ]; then
helm template ${{ env.app }} -f values.yaml charts ${HELM_OPTS}
helm upgrade --install ${{ env.app }} -f values.yaml charts ${HELM_OPTS}
else
helm template ${{ env.app }} -f values.yaml charts ${HELM_OPTS}
helm upgrade --install ${{ env.app }} -f values.yaml charts ${HELM_OPTS}
fi