update kube actions

This commit is contained in:
2024-03-11 20:39:03 +01:00
parent d3be181d77
commit 2e233abfd6
3 changed files with 60 additions and 15 deletions

View File

@@ -1,18 +1,38 @@
name: Release Auth service to Docker Hub and Deploy to Kubernetes
on:
push:
# branches:
# - 'main'
paths:
- "auth-service/**"
- "deployment/auth-service/**"
push:
paths:
- "auth-service/**"
- "deployment/auth-service/**"
- ".github/workflows/auth-service-cd.yml"
jobs:
docker:
name: Build and Push Auth-service image to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
id: create_image_tag
with:
script: |
if (context.issue.number) {
return "pr" + context.issue.number;
} else if(github.ref == 'refs/heads/main') {
return 'latest';
} else {
return "pr" + (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0].number;
}
result-encoding: string
- name: Image tag
run: echo '${{steps.create_image_tag.outputs.result}}'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
@@ -27,9 +47,11 @@ jobs:
with:
push: true
context: "{{defaultContext}}:auth-service"
tags: vcscsvcscs/gheritage-auth-service:latest
tags: vcscsvcscs/gheritage-auth-service:${{steps.create_image_tag.outputs.result}}
deployment:
name: Deploy to Kubernetes
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: docker
steps:

View File

@@ -1,18 +1,38 @@
name: Release Backend service to Docker Hub and Deploy to Kubernetes
on:
push:
# branches:
# - 'main'
paths:
- "backend/**"
- "deployment/backend/**"
push:
paths:
- "backend/**"
- "deployment/backend/**"
- ".github/workflows/backend-cd.yml"
jobs:
docker:
name: Build and Push Backend image to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
id: create_image_tag
with:
script: |
if (context.issue.number) {
return "pr" + context.issue.number;
} else if(github.ref == 'refs/heads/main') {
return 'latest';
} else {
return "pr" + (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0].number;
}
result-encoding: string
- name: Image tag
run: echo '${{steps.create_image_tag.outputs.result}}'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
@@ -27,9 +47,11 @@ jobs:
with:
push: true
context: "{{defaultContext}}:backend"
tags: vcscsvcscs/gheritage-backend-service:latest
tags: vcscsvcscs/gheritage-backend-service:${{steps.create_image_tag.outputs.result}}
deployment:
name: Deploy to Kubernetes
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: docker
steps:

View File

@@ -5,6 +5,7 @@ on:
# - main
paths:
- 'deployment/zitadel_values.yaml'
- '.github/workflows/deploy_zitadel.yml'
jobs:
deployment:
@@ -18,7 +19,7 @@ jobs:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -f deployment/certs-job.yaml
- name: 'Deploy Database'
uses: 'vimeda/helm@v1'
with: