mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
feat(infrastructure): add workers as separate deployment, update workflow
This commit is contained in:
22
.github/workflows/workflow.yml
vendored
22
.github/workflows/workflow.yml
vendored
@@ -35,16 +35,20 @@ jobs:
|
||||
- name: Get image digest
|
||||
run: echo "IMAGE_DIGEST=${{ steps.build.outputs.digest }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Update manifest with new image digest
|
||||
- name: Update manifests with new image digest
|
||||
uses: OpsVerseIO/image-updater-action@0.1.0
|
||||
with:
|
||||
valueFile: 'deployment/guestbook-ui-deployment.yaml'
|
||||
propertyPath: 'spec.template.spec.containers[0].image'
|
||||
value: ${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}
|
||||
commitChange: true
|
||||
message: "${{ github.event.head_commit.message }}"
|
||||
branch: main
|
||||
targetBranch: main
|
||||
createPR: 'false'
|
||||
masterBranchName: 'main'
|
||||
targetBranch: 'main'
|
||||
branch: 'main'
|
||||
message: 'Update image digest in manifests'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
changes: |
|
||||
{
|
||||
"deployment/app-demo-deployment.yaml": {
|
||||
"spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
||||
},
|
||||
"deployment/app-demo-worker-deployment.yaml": {
|
||||
"spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,3 @@ spec:
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
- image: lukastrkan/cc-app-demo
|
||||
name: app-demo-worker
|
||||
command: [ "python3", "worker/email_worker.py" ]
|
||||
|
||||
19
deployment/app-demo-worker-deployment.yaml
Normal file
19
deployment/app-demo-worker-deployment.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: app-demo-worker
|
||||
spec:
|
||||
replicas: 2
|
||||
revisionHistoryLimit: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: app-demo-worker
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: app-demo-worker
|
||||
spec:
|
||||
containers:
|
||||
- image: lukastrkan/cc-app-demo@sha256:10590db789cef5f1a58bb603cce0b502ce2b4054af956d9b71d60e3f02045894
|
||||
name: app-demo-worker
|
||||
command: [ "python3", "worker/email_worker.py" ]
|
||||
Reference in New Issue
Block a user