This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use @socialgouv/actions (#524)
* feat: use @socialgouv/actions * test * dockerfile * dockerfile * dockerfile * dockerfile * fix: mv server * fix: add PG to app container * dockerfile * dockerfile * dockerfile * port * fix
- Loading branch information
Julien Bouquillon
authored
Sep 16, 2021
1 parent
f4bd5f7
commit be58df3
Showing
30 changed files
with
454 additions
and
396 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-94v9x |
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-94v9x |
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-tgccq |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/renovate", | ||
"extends": ["github>SocialGouv/renovate-config:light", ":automergeAll"] | ||
"extends": ["github>SocialGouv/renovate-config:light"] | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: 🇫🇷 | ||
|
||
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.KUBECONFIG }} |
This file was deleted.
Oops, something went wrong.
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,98 @@ | ||
name: Production | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: preproduction | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
############################################################################## | ||
## BUILD AND REGISTER DOCKER IMAGE | ||
############################################################################## | ||
register: | ||
name: Build & Register docker images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get project name | ||
run: | | ||
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV | ||
- name: Application | ||
uses: SocialGouv/actions/autodevops-build-register@master | ||
with: | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
imageName: ${{ env.project }}/app | ||
|
||
- name: Hasura | ||
uses: SocialGouv/actions/autodevops-build-register@master | ||
with: | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
imageName: ${{ env.project }}/hasura | ||
dockercontext: ./hasura | ||
dockerfile: ./hasura/Dockerfile | ||
|
||
############################################################################## | ||
## GENERATE PREPRODUCTION MANIFESTS | ||
############################################################################## | ||
manifests: | ||
name: Preproduction manifests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Use k8s manifests generation | ||
uses: SocialGouv/actions/k8s-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://sample-next-app-preprod.${{ env.SOCIALGOUV_BASE_DOMAIN }} | ||
steps: | ||
- name: Use autodevops deployment | ||
uses: SocialGouv/actions/autodevops-deploy@master | ||
with: | ||
environment: "preprod" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
kubeconfig: ${{ secrets.KUBECONFIG }} | ||
|
||
############################################################################## | ||
## GENERATE PRODUCTION MANIFESTS | ||
############################################################################## | ||
manifests-prod: | ||
name: Production manifests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Use k8s manifests generation | ||
uses: SocialGouv/actions/k8s-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://sample-next-app.${{ env.SOCIALGOUV_BASE_DOMAIN }} | ||
steps: | ||
- name: Use autodevops deployment | ||
uses: SocialGouv/actions/autodevops-deploy@master | ||
with: | ||
environment: "prod" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
kubeconfig: ${{ secrets.KUBECONFIG }} |
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,27 @@ | ||
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/[email protected] | ||
@semantic-release/[email protected] | ||
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,67 @@ | ||
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 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get project name | ||
run: | | ||
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV | ||
- name: Application | ||
uses: SocialGouv/actions/autodevops-build-register@master | ||
with: | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
imageName: ${{ env.project }}/app | ||
|
||
- name: Hasura | ||
uses: SocialGouv/actions/autodevops-build-register@master | ||
with: | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
imageName: ${{ env.project }}/hasura | ||
dockercontext: ./hasura | ||
dockerfile: ./hasura/Dockerfile | ||
|
||
############################################################################## | ||
## GENERATE KUBERNETES MANIFESTS | ||
############################################################################## | ||
manifests: | ||
name: Generate k8s manifests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Use k8s manifests generation | ||
uses: SocialGouv/actions/k8s-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.KUBECONFIG }} |
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
concurrency: | ||
cancel-in-progress: true | ||
group: ${{ github.head_ref }} | ||
|
||
jobs: | ||
|
||
############################################################################## | ||
## TEST APPLICATION | ||
############################################################################## | ||
test: | ||
name: Test application | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Node setup | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Yarn cache setup | ||
uses: c-hive/gha-yarn-cache@v1 | ||
|
||
- name: Install dependencies | ||
run: yarn --frozen-lockfile --prefer-offline | ||
|
||
- name: Run tests | ||
run: yarn test --coverage |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.