Skip to content

Commit

Permalink
ci: 👷 deploy preprod with kube instead of terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-tobi committed Jul 22, 2023
1 parent 6e2cf0d commit f96f442
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/change-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
type: string
description: "Namespace name in kubernetes cluster"
default: "basegun"
domain:
required: true
type: string
description: "Nom de domaine utilisé par l'application"
default: "basegun.fr"
branch:
required: true
type: string
Expand Down Expand Up @@ -69,8 +74,12 @@ jobs:
- name: Update Infra Version
run: |
export TAG=$(make get-current-tag)
yq -i '.backend.image.tag = strenv(TAG)' ./infra/kube/basegun/values.yaml
yq -i '.frontend.image.tag = strenv(TAG)' ./infra/kube/basegun/values.yaml
yq -i '.backend.image.tag = strenv(TAG)' ./infra/kube/helm/values.yaml
yq -i '.frontend.image.tag = strenv(TAG)' ./infra/kube/helm/values.yaml
- name: Update ingress domaine
run: |
yq -i '.ingress.hosts[0].host = ${{ inputs.domain }}' ./infra/kube/helm/values.yaml
- name: Commit and push changes
uses: devops-infra/[email protected]
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/preprod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,31 @@ jobs:
organization: datalab-mi
container: basegun/basegun-backend
dry-run: false
untagged: true
prune-untagged: true
- name: Delete untagged images
uses: vlaurin/action-ghcr-prune@main
with:
token: ${{ secrets.PERSO_ACCESS_TOKEN }}
organization: datalab-mi
container: basegun/basegun-frontend
dry-run: false
untagged: true
prune-untagged: true

deploy-preprod:
uses: ./.github/workflows/deploy.yml
uses: ./.github/workflows/change-values.yml
needs: build-push
with:
image_version: "develop"
branch: ${{ github.ref_name }}
volume_size: 10
flavor: "s1-2"
workspace: "preprod"
namespace: basegun-preprod
domain: preprod.basegun.fr
secrets:
API_OVH_TOKEN: ${{ secrets.API_OVH_TOKEN }}
SERVER_IP: ${{ secrets.PREPROD_SERVER_IP }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_ID: ${{ secrets.OS_PROJECT_ID }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
X_OVH_TOKEN: ${{ secrets.PREPROD_OVH_TOKEN }}
JOB_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KUBECONFIG: ${{ secrets.PREPROD_K8_CONFIG }}

test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit f96f442

Please sign in to comment.