diff --git a/.github/workflows/request-grav.yml b/.github/workflows/request-grav.yml index d13fff9..5ae0025 100644 --- a/.github/workflows/request-grav.yml +++ b/.github/workflows/request-grav.yml @@ -1,5 +1,8 @@ name: Demander un site web GRAV on: + push: + branches: + - feature/grav-automation workflow_dispatch: inputs: domaine: @@ -15,17 +18,22 @@ on: required: false description: Contexte sur la demande +env: + domaine: grav.omni.cedille.club + nom_club: demo + contexte: Hello World + jobs: create_pr: runs-on: ubuntu:latest - env: - j2_vars: | - deployment_name=${{inputs.nom_club}} - repo_name=grav-${{inputs.nom_club}} - repo_url=https://github.com/ClubCedille/grav-${{inputs.nom_club}}.git - namespace=grav-${{inputs.nom_club}} - hostname=${{inputs.domaine}} - requester=${{github.event.sender.name}} + # env: + # j2_vars: | + # deployment_name=${{env.nom_club}} + # repo_name=grav-${{env.nom_club}} + # repo_url=https://github.com/ClubCedille/grav-${{env.nom_club}}.git + # namespace=grav-${{env.nom_club}} + # hostname=${{env.domaine}} + # requester=${{github.event.sender.name}} steps: - name: Checkout uses: actions/checkout@v4 @@ -33,28 +41,46 @@ jobs: uses: cuchi/jinja2-action@v1.2.2 with: template: bases/grav/prod-templates/kustomization.yaml.jinja2 - output_file: apps/${{inputs.nom_club}}/grav/prod/kustomization.yaml + output_file: apps/${{env.nom_club}}/grav/prod/kustomization.yaml strict: true - variables: ${{env.j2_vars}} + variables: | + deployment_name=${{env.nom_club}} + repo_name=grav-${{env.nom_club}} + repo_url=https://github.com/ClubCedille/grav-${{env.nom_club}}.git + namespace=grav-${{env.nom_club}} + hostname=${{env.domaine}} + requester=${{github.event.sender.name}} - name: Create vault-patch uses: cuchi/jinja2-action@v1.2.2 with: template: bases/grav/prod-templates/vault-patch.yaml.jinja2 - output_file: apps/${{inputs.nom_club}}/grav/prod/vault-patch.yaml + output_file: apps/${{env.nom_club}}/grav/prod/vault-patch.yaml strict: true - variables: ${{env.j2_vars}} + variables: | + deployment_name=${{env.nom_club}} + repo_name=grav-${{env.nom_club}} + repo_url=https://github.com/ClubCedille/grav-${{env.nom_club}}.git + namespace=grav-${{env.nom_club}} + hostname=${{env.domaine}} + requester=${{github.event.sender.name}} - name: Create terraform repo uses: cuchi/jinja2-action@v1.2.2 with: template: terraform/github/apps-repos/grav.tf.jinja2 - output_file: terraform/github/apps-repos/grav-${{inputs.nom_club}}.tf + output_file: terraform/github/apps-repos/grav-${{env.nom_club}}.tf strict: true - variables: ${{env.j2_vars}} + variables: | + deployment_name=${{env.nom_club}} + repo_name=grav-${{env.nom_club}} + repo_url=https://github.com/ClubCedille/grav-${{env.nom_club}}.git + namespace=grav-${{env.nom_club}} + hostname=${{env.domaine}} + requester=${{github.event.sender.name}} - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - title: Create a GRAV website for ${{inputs.nom_club}} + title: Create a GRAV website for ${{env.nom_club}} body: | - Nom du club: ${{inputs.nom_club}} - Domaine: ${{inputs.domaine}} - Contexte: ${{inputs.contexte}} \ No newline at end of file + Nom du club: ${{env.nom_club}} + Domaine: ${{env.domaine}} + Contexte: ${{env.contexte}} \ No newline at end of file