Skip to content

Merge Repository

Merge Repository #657

name: Merge Repository
on:
schedule:
- cron: '0 1 * * *' # nightly at 1 am UTC
push:
branches: [ main ]
paths:
- generation/**
pull_request:
branches: [ main ]
paths:
- generation/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate
run: ./generation/merge_repository.sh
env:
USERNAME: ${{ github.actor }}
- name: Compile
working-directory: generation/monorepo/google-cloud-java-merged
run: mvn compile -T 1C -B
- name: Unit Tests
working-directory: generation/monorepo/google-cloud-java-merged
run: mvn test -T 1C -B
- name: Push monorepo to branch
if: ${{ github.event_name != 'pull_request' }}
run: |
cd generation/monorepo/google-cloud-java-merged
git remote add monorepo https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git
git push -f monorepo main:bootstrap_output
- name: Push diff to branch
run: |
cd generation/monorepo/diff
git remote add monorepo https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git
git push -f monorepo main:bootstrap_output_diff_${{ github.event_name }}