From 5daafa6d397cb975db329ff83f80992903407eb1 Mon Sep 17 00:00:00 2001 From: MartinezAvellan Date: Fri, 1 Nov 2024 16:27:57 +0100 Subject: [PATCH] feat: gitaction to update midaz submodule in midaz-full :sparkles: --- .../workflows/update-midaz-full-submodule.yml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/update-midaz-full-submodule.yml diff --git a/.github/workflows/update-midaz-full-submodule.yml b/.github/workflows/update-midaz-full-submodule.yml new file mode 100644 index 00000000..a51bb9ba --- /dev/null +++ b/.github/workflows/update-midaz-full-submodule.yml @@ -0,0 +1,52 @@ +name: Update Submodule midaz in midaz-full +on: + push: + branches: + - main + +jobs: + update-submodule: + runs-on: ubuntu-latest + + steps: + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + id: import_gpg + with: + gpg_private_key: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY }} + passphrase: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY_PASSWORD }} + git_committer_name: ${{ secrets.LERIAN_CI_CD_USER_NAME }} + git_committer_email: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} + git_config_global: true + git_user_signingkey: true + git_commit_gpgsign: true + + - name: Pull midaz-full and submodules + uses: actions/checkout@v4 + with: + repository: LerianStudio/midaz-full + ref: main + path: midaz-full + submodules: recursive + token: ${{ secrets.MANAGE_TOKEN }} + + - name: Push midaz-full and midaz submodule + env: + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GITHUB_TOKEN: ${{ secrets.MANAGE_TOKEN }} + GIT_AUTHOR_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} + GIT_AUTHOR_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} + GIT_COMMITTER_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} + GIT_COMMITTER_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} + run: | + cd midaz-full + + cd midaz + git checkout main + git pull origin main + + cd .. + + git add midaz + git commit -S -m "Updating the submodule 'midaz' to the latest version" + git push origin main \ No newline at end of file