From 8cd0a53c7c0e14975688afc00447465077c41113 Mon Sep 17 00:00:00 2001 From: Jakub Kulhan Date: Thu, 23 May 2024 16:05:32 +0200 Subject: [PATCH] split and push github action --- .github/workflows/split-and-push.yaml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/split-and-push.yaml diff --git a/.github/workflows/split-and-push.yaml b/.github/workflows/split-and-push.yaml new file mode 100644 index 0000000..3250b83 --- /dev/null +++ b/.github/workflows/split-and-push.yaml @@ -0,0 +1,30 @@ +on: + push: + branches: + - main + +jobs: + split-and-push: + runs-on: ubuntu-latest + strategy: + matrix: + project: + - name: data-access-kit + key: ${{ secrets.DATA_ACCESS_KIT_DEPLOY_KEY }} + - name: data-access-kit-symfony + key: ${{ secrets.DATA_ACCESS_KIT_SYMFONY_DEPLOY_KEY }} + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + steps: + - uses: actions/checkout@v2 + - run: | + git config --global user.name "Jakub Kulhan" + git config --global user.email "ahoj@jakubkulhan.cz" + - run: | + mkdir -p ~/.ssh + chmod 600 ~/.ssh + ssh-keyscan github.com >> ~/.ssh/known_hosts + ssh-agent -a $SSH_AGENT_SOCK > /dev/null + echo "${{ matrix.project.key }}" | ssh-add - + - run: git subtree split --prefix=${{ matrix.project }} --branch project-branch + - run: git push --force git@github.com:${{ github.repository_owner }}/${{ matrix.project }}.git project-branch:main