-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfb87f6
commit 0b15a52
Showing
10 changed files
with
238 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-v79sd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-v79sd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SOCIALGOUV_BASE_DOMAIN=fabrique.social.gouv.fr | ||
RANCHER_PROJECT_ID=c-5rj5b:p-7f92z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Deactivate | ||
|
||
on: | ||
pull_request: | ||
types: [ closed ] | ||
|
||
jobs: | ||
prune: | ||
name: Deactivate environment | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Get branch, project and namespace names | ||
run: | | ||
echo "branch=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV | ||
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV | ||
echo "namespace=${GITHUB_REPOSITORY#*/}-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV | ||
- name: Install Kapp | ||
uses: vmware-tanzu/carvel-setup-action@v1 | ||
with: | ||
only: kapp | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create kubernetes config | ||
run: | | ||
mkdir ~/.kube | ||
touch ~/.kube/config | ||
echo ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }} | base64 -d > ~/.kube/config | ||
- name: Delete k8s environment | ||
run: kapp -y delete --namespace ${{ env.namespace }} | ||
# run: kapp -y delete -a ${{ env.project }} --namespace ${{ env.namespace }} | ||
|
||
- name: Mark environment as deactivated | ||
uses: bobheadxi/deployments@v0.4.3 | ||
with: | ||
step: deactivate-env | ||
env: ${{ env.branch }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
desc: "Environment ${{ env.namespace }} has been deactivated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Production | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: preproduction | ||
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: | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
imageName: monsuivipsy/monsuivipsy-site | ||
|
||
############################################################################## | ||
## 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 preproduction | ||
runs-on: ubuntu-latest | ||
needs: [register, manifests] | ||
environment: | ||
name: preproduction | ||
url: https://${{ env.namespace }}.${{ env.SOCIALGOUV_BASE_DOMAIN }} | ||
steps: | ||
|
||
- 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" | ||
|
||
############################################################################## | ||
## DEPLOY PRODUCTION APPLICATION | ||
############################################################################## | ||
deploy-prod: | ||
name: Deploy production | ||
runs-on: ubuntu-latest | ||
needs: [deploy-preprod, manifests-prod] | ||
environment: | ||
name: production | ||
url: https://${{ env.namespace }}.${{ env.SOCIALGOUV_BASE_DOMAIN }} | ||
steps: | ||
|
||
- name: Use autodevops deployment | ||
uses: SocialGouv/actions/autodevops-deploy@master | ||
with: | ||
environment: "prod" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_PROD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Review | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- v* | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
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: | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
imageName: monsuivipsy/monsuivipsy-site | ||
|
||
############################################################################## | ||
## 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters