-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.24 KB
/
deploy.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
69
70
71
72
73
74
75
name: build-deploy
on:
push:
branches:
- master
jobs:
build:
name: build-image
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: docker-action
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY }}
repository: "${{ github.repository }}"
tags: "${{ github.sha }}"
- name: feishu-bot-message
if: always()
uses: foxundermoon/feishu-action@v2
with:
url: ${{ secrets.FEISHU_BOT_WEBHOOK_URL }}
msg_type: text
content: |
text: |
🔨 构建状态 - From Github Action
repository: https://github.com/${{ github.repository }}
committer: https://github.com/${{ github.actor }}
compare: ${{ github.event.compare }}
job status: ${{ job.status }}
deploy:
needs: build
name: k8s-deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: set-deployment-config
run: |
XIMAGE="${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }}:${{ github.sha }}"
sed -i "s#HAPPYIMAGE#$XIMAGE#g" ./chart/config.yaml
sed -i "s#HAPPYREPO#${{ github.event.repository.name }}#g" ./chart/config.yaml
sed -i "s#BOT_API#${{ secrets.BOT_API }}#g" ./chart/config.yaml
- name: k3s-apply-deployment
uses: steebchen/kubectl@v2.0.0
with:
config: ${{ secrets.KUBE_CONFIG_DATA }}
command: apply -f ./chart/config.yaml
- name: feishu-bot-message
if: always()
uses: foxundermoon/feishu-action@v2
with:
url: ${{ secrets.FEISHU_BOT_WEBHOOK_URL }}
msg_type: text
content: |
text: |
⭕️ 部署状态 - From Github Action
repository: https://github.com/${{ github.repository }}
committer: https://github.com/${{ github.actor }}
compare: ${{ github.event.compare }}
job status: ${{ job.status }}