Skip to content

Ajout des améliorations infra suite à l'intégration TDB #759

Ajout des améliorations infra suite à l'intégration TDB

Ajout des améliorations infra suite à l'intégration TDB #759

Workflow file for this run

name: PR CI and Preview
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, closed]
jobs:
tests:
if: github.event.pull_request.state == 'open'
uses: "./.github/workflows/ci.yml"
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
deploy:
if: github.event.pull_request.draft == false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: Deploy Preview ${{ github.event.pull_request.number }}
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
name: github_actions
key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
config: |
Host *
IdentityFile ~/.ssh/github_actions
- name: Create vault pwd file
run: echo ${{ secrets.VAULT_PWD }} > .infra/.vault_pwd.txt
- name: Install jmespath
run: |
sudo pipx inject ansible-core jmespath
- name: Run playbook
run: .bin/mna-bal deploy preview "${{ github.event.pull_request.number }}"
env:
ANSIBLE_VAULT_PASSWORD_FILE: .infra/.vault_pwd.txt
ANSIBLE_REMOTE_USER: deploy
ANSIBLE_BECOME_PASS: ${{ secrets.DEPLOY_PASS }}
- name: Preview Summary
run: echo 'https://${{ github.event.pull_request.number }}.bal-preview.apprentissage.beta.gouv.fr/ 🚀' >> $GITHUB_STEP_SUMMARY
- name: Comment PR Preview
if: github.event.pull_request.state != 'closed'
uses: thollander/actions-comment-pull-request@v2
with:
message: |
### :rocket: Prévisualisation
https://${{ github.event.pull_request.number }}.bal-preview.apprentissage.beta.gouv.fr/
comment_tag: execution
mode: recreate