Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use autodevops actions. #16

Merged
merged 6 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SOCIALGOUV_BASE_DOMAIN=dev.fabrique.social.gouv.fr
RANCHER_PROJECT_ID=c-gjtkk:p-5wvx7
2 changes: 2 additions & 0 deletions .github/preprod.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SOCIALGOUV_BASE_DOMAIN=dev.fabrique.social.gouv.fr
RANCHER_PROJECT_ID=c-gjtkk:p-5wvx7
1 change: 1 addition & 0 deletions .github/prod.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SOCIALGOUV_BASE_DOMAIN=fabrique.social.gouv.fr
3 changes: 3 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["github>SocialGouv/renovate-config:light"]
}
14 changes: 14 additions & 0 deletions .github/workflows/deactivate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Deactivate

on:
pull_request:
types: [ closed ]

jobs:
bury_review_env:
name: 🪦 Review
runs-on: ubuntu-latest
steps:
- uses: SocialGouv/actions/k8s-funeral@master
with:
kube-config: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}
114 changes: 114 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Production

on:
push:
tags:
- v*

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

jobs:

##############################################################################
## BUILD AND REGISTER DOCKER 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:
project: ${{ env.project }}
token: ${{ secrets.GITHUB_TOKEN }}
imageName: nos1000jours/les1000jours-landing

##############################################################################
## GENERATE PREPRODUCTION MANIFESTS
##############################################################################
manifests:
name: Preproduction manifests
runs-on: ubuntu-latest
steps:

- name: Use autodevops manifests generation
uses: SocialGouv/actions/autodevops-manifests@master
with:
environment: "preprod"

##############################################################################
## DEPLOY PREPRODUCTION APPLICATION
##############################################################################
deploy-preprod:
name: Deploy application
runs-on: ubuntu-latest
needs: [register, manifests]
environment:
name: preproduction
url: https://${{ env.ns }}.${{ env.SOCIALGOUV_BASE_DOMAIN }}
steps:

- name: Checkout repository
uses: actions/checkout@v2

- name: Get project and namespace names
run: |
cat ".github/preprod.env" >> $GITHUB_ENV
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
echo "ns=${GITHUB_REPOSITORY#*/}-${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-deploy@master
with:
environment: "preprod"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}

##############################################################################
## GENERATE PRODUCTION MANIFESTS
##############################################################################
manifests-prod:
name: Production manifests
runs-on: ubuntu-latest
steps:

- name: Use autodevops manifests generation
uses: SocialGouv/actions/autodevops-manifests@master
with:
environment: "prod"
productionNamespace: "les1000jours-landing"

##############################################################################
## DEPLOY PRODUCTION APPLICATION
##############################################################################
deploy-prod:
name: Deploy application
runs-on: ubuntu-latest
needs: [deploy-preprod, manifests-prod]
environment:
name: production
url: https://${{ env.ns }}.${{ env.SOCIALGOUV_BASE_DOMAIN }}
steps:

- name: Checkout repository
uses: actions/checkout@v2

- name: Get project and namespace names
run: |
cat ".github/prod.env" >> $GITHUB_ENV
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
echo "ns=${GITHUB_REPOSITORY#*/}-${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-deploy@master
with:
environment: "prod"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_PROD }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
workflow_dispatch:
push:
branches: [master, alpha, beta, next]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
extra_plugins: |
@semantic-release/changelog@5.0.1
@semantic-release/git@9.0.0
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
62 changes: 62 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Review

on:
push:
branches:
- '**'
tags-ignore:
- v*

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

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@master
with:
project: ${{ env.project }}
token: ${{ secrets.GITHUB_TOKEN }}
imageName: nos1000jours/les1000jours-landing

##############################################################################
## GENERATE KUBERNETES MANIFESTS
##############################################################################
manifests:
name: Generate k8s manifests
runs-on: ubuntu-latest
steps:

- name: Use autodevops manifests generation
uses: SocialGouv/actions/autodevops-manifests@master
with:
environment: "dev"

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

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-deploy@master
with:
environment: "dev"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}
52 changes: 0 additions & 52 deletions .gitlab-ci.yml

This file was deleted.

Loading