-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.99 KB
/
deploy.yml
File metadata and controls
64 lines (54 loc) · 1.99 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
60
61
62
63
64
name: Deploy
on:
workflow_dispatch:
inputs:
environment:
description: "Target environment"
required: false
default: "staging"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push authz image
uses: docker/build-push-action@v7
with:
context: .
file: services/authz/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/authz:sha-${{ github.sha }}
- name: Build and push inventory image
uses: docker/build-push-action@v7
with:
context: .
file: services/inventory/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/inventory:sha-${{ github.sha }}
- name: Build and push app image
uses: docker/build-push-action@v7
with:
context: .
file: app/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/app:sha-${{ github.sha }}
- name: Update Kubernetes manifests with new image tags
run: |
cd deploy/kubernetes
sed -i "s|image: ghcr.io/evalops/keep/authz:.*|image: ghcr.io/${{ github.repository }}/authz:sha-${{ github.sha }}|" authz-deployment.yaml
sed -i "s|image: ghcr.io/evalops/keep/inventory:.*|image: ghcr.io/${{ github.repository }}/inventory:sha-${{ github.sha }}|" inventory-deployment.yaml
sed -i "s|image: ghcr.io/evalops/keep/app:.*|image: ghcr.io/${{ github.repository }}/app:sha-${{ github.sha }}|" app-deployment.yaml