Skip to content

Sync Mirrors

Sync Mirrors #4

Workflow file for this run

# 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:
sync:
if: github.repository == 'aspect-build/bazel-examples'
strategy:
matrix:
dest: ["cci", "gha"]
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
- name: Setup credentials (cci)
if: matrix.dest == 'cci'
run: |
eval $(ssh-agent -s)
ssh-add - <<< '${{ secrets.BAZEL_EXAMPLES_CCI_DEPLOY_TOKEN }}'
- name: Setup credentials (gha)
if: matrix.dest == 'gha'
run: |
eval $(ssh-agent -s)
ssh-add - <<< '${{ secrets.BAZEL_EXAMPLES_GHA_DEPLOY_TOKEN }}'
- name: Push commits
working-directory: fresh-clone
run: git push git@github.com:aspect-build/bazel-examples-${{ matrix.dest }}.git HEAD:alex-test