Skip to content

Commit

Permalink
fix(ci): use kube-workflow (#62)
Browse files Browse the repository at this point in the history
* fix(ci): use kube-workflow

* fix preprod url

* fix: url

* Update values.yaml
  • Loading branch information
Julien Bouquillon authored Mar 23, 2022
1 parent eff3e9e commit 9056399
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 110 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/preproduction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,25 @@ on:
push:
branches:
- master
tags-ignore:
- v*

concurrency:
cancel-in-progress: true
group: preproduction

jobs:
##############################################################################
## BUILD AND REGISTER DOCKER IMAGES
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: "preprod"
project: ${{ env.project }}
environment: preprod
imagePackage: app
token: ${{ secrets.GITHUB_TOKEN }}
imageName: monsuivipsy/monsuivipsy-site

##############################################################################
## DEPLOY APPLICATION OVER KUBERNETES
##############################################################################
deploy:
name: Deploy application
runs-on: ubuntu-latest
Expand All @@ -39,13 +31,11 @@ jobs:
name: preproduction
url: https://monsuivipsy-site-preprod.dev.fabrique.social.gouv.fr
steps:
- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-helm-deploy@v1
- name: Use kube-workflow deployment
uses: SocialGouv/kube-workflow@v1
with:
environment: "preprod"
environment: preprod
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }}
imageName: monsuivipsy/monsuivipsy-site
51 changes: 17 additions & 34 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,30 @@ concurrency:
cancel-in-progress: true

jobs:

##############################################################################
## BUILD AND REGISTER APPLICATION IMAGE
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:

- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@master
with:
environment: prod
project: ${{ env.project }}
token: ${{ secrets.GITHUB_TOKEN }}
imageName: monsuivipsy/monsuivipsy-site


##############################################################################
## DEPLOY PRODUCTION APPLICATION
##############################################################################
deploy-prod:
name: Deploy production
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: prod
imagePackage: app
token: ${{ secrets.GITHUB_TOKEN }}

deploy:
name: Deploy application
runs-on: ubuntu-latest
needs: [register]
environment:
name: production
url: https://monsuivipsy.fabrique.social.gouv.fr
steps:

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-helm-deploy@v1
with:
environment: "prod"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_PROD }}
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
imageName: monsuivipsy/monsuivipsy-site
productionHost: monsuivipsy.fabrique.social.gouv.fr
- name: Use kube-workflow deployment
uses: SocialGouv/kube-workflow@v1
with:
environment: prod
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
47 changes: 16 additions & 31 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,31 @@ on:
- v*

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
group: review-${{ github.ref }}

jobs:

##############################################################################
## BUILD AND REGISTER APPLICATION IMAGE
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
imagePackage: app
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@master
with:
project: ${{ env.project }}
token: ${{ secrets.GITHUB_TOKEN }}
imageName: monsuivipsy/monsuivipsy-site

##############################################################################
## DEPLOY APPLICATION OVER KUBERNETES
##############################################################################
deploy:
name: Deploy application
name: Deploy review branch
runs-on: ubuntu-latest
needs: [register]
steps:

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-helm-deploy@v1
with:
environment: "dev"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }}
imageName: monsuivipsy/monsuivipsy-site
- name: Use kube-workflow deployment
uses: SocialGouv/kube-workflow@v1
with:
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
3 changes: 3 additions & 0 deletions .kube-workflow/common/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
app:
enabled: true
probesPath: /api/healthz
2 changes: 2 additions & 0 deletions .kube-workflow/env/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
app:
host: monsuivipsy.fabrique.social.gouv.fr
6 changes: 0 additions & 6 deletions .socialgouv/config.json

This file was deleted.

21 changes: 0 additions & 21 deletions .socialgouv/environments/prod/yaml/redirect.yaml

This file was deleted.

0 comments on commit 9056399

Please sign in to comment.