-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #204 from adobecom/stage
[Release] Stage to Main
- Loading branch information
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,15 @@ name: Floodgate Repo Sync | |
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
syncBranch: | ||
description: 'Branch to sync' | ||
required: true | ||
default: 'stage' | ||
type: choice | ||
options: | ||
- 'stage' | ||
- 'main' | ||
|
||
jobs: | ||
build: | ||
|
@@ -17,30 +26,42 @@ jobs: | |
repositories: "bacom-pink" | ||
|
||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
ref: ${{ inputs.syncBranch }} | ||
|
||
- name: Clone Floodgate Repository | ||
- name: Clone Floodgate Repository and Checkout Selected Branch | ||
run: | | ||
git clone https://github.com/adobecom/bacom-pink.git ../bacom-pink | ||
cd ../bacom-pink | ||
git checkout $FG_SYNC_BRANCH | ||
echo "bacom-pink branch" | ||
git branch | ||
cd ../bacom | ||
echo "bacom branch" | ||
git branch | ||
env: | ||
FG_SYNC_BRANCH: ${{ inputs.syncBranch }} | ||
|
||
- name: Overwrite floodgate repo files with latest from source repo | ||
run: | | ||
rsync -av --exclude='fstab.yaml' --exclude='.github' --exclude='.git' --exclude='.idea' --exclude='tools/sidekick/config.json' ./ ../bacom-pink/ | ||
rsync -av --exclude='fstab.yaml' --exclude='.github' --exclude='.kodiak' --exclude='.git' --exclude='.idea' --exclude='.husky' --exclude='.vscode' --exclude='tools/sidekick/config.json' ./ ../bacom-pink/ | ||
- name: Commit and Push Changes to Floodgate Repository | ||
run: | | ||
cd ../bacom-pink | ||
echo "bacom-pink branch" | ||
git branch | ||
git config user.email "$FG_SYNC_BOT_EMAIL" | ||
git config user.name "$FG_SYNC_BOT_NAME" | ||
git status | ||
git remote set-url origin https://oauth2:[email protected]/adobecom/bacom-pink.git | ||
git remote -v | ||
git add . | ||
git commit -m "Syncing bacom to bacom-pink" | ||
git push origin main --force | ||
git push origin $FG_SYNC_BRANCH --force | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | ||
FG_SYNC_BOT_EMAIL: ${{ secrets.FG_SYNC_BOT_EMAIL }} | ||
FG_SYNC_BOT_NAME: ${{ secrets.FG_SYNC_BOT_NAME }} | ||
FG_SYNC_BRANCH: ${{ inputs.syncBranch }} |
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
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