mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +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
|
- name: Get image digest
|
||||||
run: echo "IMAGE_DIGEST=${{ steps.build.outputs.digest }}" >> $GITHUB_ENV
|
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
|
uses: OpsVerseIO/image-updater-action@0.1.0
|
||||||
with:
|
with:
|
||||||
valueFile: 'deployment/guestbook-ui-deployment.yaml'
|
branch: main
|
||||||
propertyPath: 'spec.template.spec.containers[0].image'
|
targetBranch: main
|
||||||
value: ${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}
|
|
||||||
commitChange: true
|
|
||||||
message: "${{ github.event.head_commit.message }}"
|
|
||||||
createPR: 'false'
|
createPR: 'false'
|
||||||
masterBranchName: 'main'
|
message: 'Update image digest in manifests'
|
||||||
targetBranch: 'main'
|
|
||||||
branch: 'main'
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
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
|
initialDelaySeconds: 60
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
failureThreshold: 3
|
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