fix: don't try to run sync job from downstreams (#397) #5
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
# We maintain mirrors of this repo for demonstrating Aspect Workflows on other CI platforms. | |
# This is documented in /.aspect/workflows/README.md. | |
# The primary repo is tested on Buildkite because it's the best | |
# https://buildkite.com/aspect/bazel-examples | |
# When commits land there, we sync them to the others: | |
# CircleCI: https://buildkite.com/aspect/bazel-examples-cci | |
# GitHub Actions: https://buildkite.com/aspect/bazel-examples-gha | |
name: Sync Mirrors | |
on: | |
workflow_dispatch: | |
push: | |
branches: ['main'] | |
jobs: | |
push-cci: | |
if: github.repository == 'aspect-build/bazel-examples' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get a full history so all commits are present | |
uses: actions/checkout@v4 | |
with: | |
path: fresh-clone | |
fetch-depth: 0 | |
- working-directory: fresh-clone | |
run: | | |
eval $(ssh-agent -s) | |
ssh-add - <<< '${{ secrets.BAZEL_EXAMPLES_CCI_DEPLOY_TOKEN }}' | |
git push git@github.com:aspect-build/bazel-examples-cci.git HEAD:main | |
push-gha: | |
if: github.repository == 'aspect-build/bazel-examples' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get a full history so all commits are present | |
uses: actions/checkout@v4 | |
with: | |
path: fresh-clone | |
fetch-depth: 0 | |
- working-directory: fresh-clone | |
run: | | |
eval $(ssh-agent -s) | |
ssh-add - <<< '${{ secrets.BAZEL_EXAMPLES_GHA_DEPLOY_TOKEN }}' | |
git push git@github.com:aspect-build/bazel-examples-gha.git HEAD:main |