-
Notifications
You must be signed in to change notification settings - Fork 13
59 lines (50 loc) · 1.82 KB
/
Copy pathdeploy.yml
File metadata and controls
59 lines (50 loc) · 1.82 KB
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
name: Build and Deploy
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
env:
DOCKER_IMAGE: ghcr.io/openbudget/budgetkey-mcp
GITHUB_SHA: ${{ github.sha }}
run: |
docker build -t ${DOCKER_IMAGE}:latest -t ${DOCKER_IMAGE}:${GITHUB_SHA} .
- name: Push Docker image
env:
DOCKER_IMAGE: ghcr.io/openbudget/budgetkey-mcp
GITHUB_SHA: ${{ github.sha }}
run: |
docker push ${DOCKER_IMAGE}:latest
docker push ${DOCKER_IMAGE}:${GITHUB_SHA}
- name: Update Kubernetes deployment
env:
GITHUB_TOKEN: ${{ secrets.K8S_GITHUB_TOKEN }}
GITHUB_SHA: ${{ github.sha }}
DOCKER_IMAGE: ghcr.io/openbudget/budgetkey-mcp
run: |
docker run -e CLONE_PARAMS="--branch master https://github.com/OpenBudget/budgetkey-k8s.git" \
-e YAML_UPDATE_JSON='{"mcp":{"image":"'"${DOCKER_IMAGE}:${GITHUB_SHA}"'"}}' \
-e YAML_UPDATE_FILE="values.auto-updated.yaml" \
-e GIT_USER_EMAIL="budgetkey-deployer@null.void" \
-e GIT_USER_NAME="budgetkey-deployer" \
-e GIT_COMMIT_MESSAGE="automatic update of budgetkey-mcp" \
-e PUSH_PARAMS="https://${GITHUB_TOKEN}@github.com/OpenBudget/budgetkey-k8s.git master" \
orihoch/github_yaml_updater