Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/pull-and-push-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: pull-and-push-all
run-name: ${{ github.actor }} is trying pull and push all
on:
schedule:
- cron: '*/30 * * * *' # you have to quote this string due to * being a special char
workflow_dispatch:


jobs:
pull-flutter:
uses: firebase/firebase-docs/.github/workflows/pull-map-and-push-repo.yml@main
permissions:
contents: write
with:
target_source_repo: https://github.com/firebase/flutterfire.git
git_commit_user_email: [email protected]
git_commit_user_name: Firebase OSS Robot
git_commit_message_text: Pull and push of flutterfire/docs by ${{github.workflow}} run ${{github.run_number}}
copy_mapping_sources: flutterfire/docs
copy_mapping_destinations: flutter
# we can add other open source doc repos here/below




110 changes: 110 additions & 0 deletions .github/workflows/pull-map-and-push-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: pull-map-and-push-repo
run-name: ${{ github.actor }} is trying to pull, map and push ${{ inputs.target_source_repo }}
on:
workflow_dispatch:
inputs:
target_source_repo:
type: string
description: 'Repo to copy in.'
default: 'https://github.com/firebase/flutterfire.git'
required: true
git_commit_user_email:
type: string
description: 'Commit user email.'
default: '[email protected]'
required: true
git_commit_user_name:
type: string
description: 'Commit user name.'
default: 'Firebase OSS Robot'
required: true
git_commit_message_text:
type: string
description: 'Commit Message Text'
default: 'Pull and push of flutterfire/docs'
required: true
copy_mapping_sources:
type: string
description: 'Source Directories'
default: 'flutterfire/docs'
required: true
copy_mapping_destinations:
type: string
description: 'Destination Directories'
default: 'flutter'
required: true
workflow_call:
inputs:
target_source_repo:
type: string
description: 'Repo to copy in.'
default: 'https://github.com/firebase/flutterfire.git'
required: true
git_commit_user_email:
type: string
description: 'Commit user email.'
default: '[email protected]'
required: true
git_commit_user_name:
type: string
description: 'Commit user name.'
default: 'Firebase OSS Robot'
required: true
git_commit_message_text:
type: string
description: 'Commit Message Text'
default: 'Pull and push of flutterfire/docs'
required: true
copy_mapping_sources:
type: string
description: 'Source Directories'
default: 'flutterfire/docs'
required: true
copy_mapping_destinations:
type: string
description: 'Destination Directories'
default: 'flutter'
required: true

jobs:
checkout-pull-and-push:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: pull-external
run: |
mkdir temp-pull && cd temp-pull &&
git clone ${{inputs.target_source_repo}} && ls -r
- name: copy-target-to-new-location
run: |
sources_array=(${{inputs.copy_mapping_sources}})
destinations_array=(${{inputs.copy_mapping_destinations}})
echo ${#sources_array[@]} ${#destinations_array[@]}
if [ ${#sources_array[@]} != ${#destinations_array[@]} ]; then
echo 'sources_array and destinations_array must be the same length. Please fix.'
exit 1
fi
for (( i=0; i<${#sources_array[@]}; i++ ))
do
echo A:B ${sources_array[$i]}:${destinations_array[$i]}
mkdir -p docs/${destinations_array[$i]}
cp -rf temp-pull/${sources_array[$i]}/. docs/${destinations_array[$i]}
done
- name: remove-temp-pull
run: rm -r temp-pull && git status --untracked-files
- name: git-commit-and-push
run: |
if [ -z "$(git status --porcelain)" ]; then
echo 'No changes detected. Exiting.'
exit 0
fi
echo 'Changes detected. Attempting to add, commit, pull --rebase and push.'
git add .
git config user.email "${{inputs.git_commit_user_email}}"
git config user.name "${{inputs.git_commit_user_name}}"
git commit -m '${{inputs.git_commit_message_text}}'
git pull --rebase
git status
git push