split and push github action #8
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
on: | |
push: | |
branches: | |
- main | |
jobs: | |
split-and-push: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: | |
- data-access-kit | |
- data-access-kit-symfony | |
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_AUTH_SOCK > /dev/null | |
echo "${{ secrets.DATA_ACCESS_KIT_DEPLOY_KEY }}" | ssh-add - | |
echo "${{ secrets.DATA_ACCESS_KIT_SYMFONY_DEPLOY_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 |