-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(workflows): Split preprod and prod workflows
- Loading branch information
1 parent
e322470
commit f26feaa
Showing
3 changed files
with
114 additions
and
44 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,104 @@ | ||
name: Preproduction | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags-ignore: | ||
- 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@v1 | ||
with: | ||
environment: preprod | ||
imageName: fabrique/carnets | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
############################################################################## | ||
## BUILD AND REGISTER HASURA IMAGE | ||
############################################################################## | ||
register-hasura: | ||
name: Build & Register Hasura | ||
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 | ||
imageName: fabrique/hasura | ||
project: ${{ env.project }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
dockerfile: ./packages/hasura/Dockerfile | ||
|
||
############################################################################## | ||
## GENERATE KUBERNETES MANIFESTS | ||
############################################################################## | ||
manifests: | ||
name: Generate k8s manifests | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Use autodevops manifests generation | ||
uses: SocialGouv/actions/autodevops-manifests@v1 | ||
with: | ||
environment: preprod | ||
rancherId: ${{ secrets.RANCHER_PROJECT_ID }} | ||
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }} | ||
|
||
############################################################################## | ||
## DEPLOY APPLICATION OVER KUBERNETES | ||
############################################################################## | ||
deploy: | ||
name: Deploy application | ||
runs-on: ubuntu-latest | ||
needs: [register, register-hasura, manifests] | ||
steps: | ||
|
||
- name: Use autodevops deployment | ||
uses: SocialGouv/actions/autodevops-deploy@v1 | ||
with: | ||
environment: preprod | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
kubeconfig: ${{ secrets.KUBECONFIG }} | ||
rancherId: ${{ secrets.RANCHER_PROJECT_ID }} | ||
|
||
############################################################################## | ||
## RESTORE DATABASE | ||
############################################################################## | ||
restore-db: | ||
name: Restore database | ||
runs-on: ubuntu-latest | ||
needs: deploy | ||
steps: | ||
|
||
- name: Use autodevops database restore | ||
uses: SocialGouv/actions/autodevops-restore-db@v1 | ||
with: | ||
kubeconfig: ${{ secrets.KUBECONFIG }} | ||
rancherId: ${{ secrets.RANCHER_PROJECT_ID }} | ||
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }} | ||
|
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 |
---|---|---|
|
@@ -2,8 +2,8 @@ name: Review | |
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
branches-ignore: | ||
- master | ||
tags-ignore: | ||
- v* | ||
|
||
|