1name: Merge Repository 2on: 3 schedule: 4 - cron: '0 1 * * *' # nightly at 1 am UTC 5 push: 6 branches: [ main ] 7 paths: 8 - generation/** 9 pull_request: 10 branches: [ main ] 11 paths: 12 - generation/** 13 14 workflow_dispatch: 15 16jobs: 17 build: 18 runs-on: ubuntu-latest 19 steps: 20 - uses: actions/checkout@v3 21 - name: Generate 22 run: ./generation/merge_repository.sh 23 env: 24 USERNAME: ${{ github.actor }} 25 - name: Compile 26 working-directory: generation/monorepo/google-cloud-java-merged 27 run: mvn compile -T C1 -B 28 - name: Unit Tests 29 working-directory: generation/monorepo/google-cloud-java-merged 30 run: mvn test -T C1 -B 31 - name: Push monorepo to branch 32 if: ${{ github.event_name != 'pull_request' }} 33 run: | 34 cd generation/monorepo/google-cloud-java-merged 35 git remote add monorepo https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git 36 git push -f monorepo main:bootstrap_output 37 - name: Push diff to branch 38 run: | 39 cd generation/monorepo/diff 40 git remote add monorepo https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git 41 git push -f monorepo main:bootstrap_output_diff_${{ github.event_name }}