-
Notifications
You must be signed in to change notification settings - Fork 2
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 #117 from SaintAngeLs/pipeline
#110: pipeline set-up
- Loading branch information
Showing
2 changed files
with
45 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Sync to Azure DevOps Repository | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
Sync: | ||
runs-on: ubuntu-latest | ||
env: | ||
AZURE_DEVOPS_PAT: ${{ secrets.AZUREDEVOPSPAT }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 # Fetch all branches | ||
|
||
- name: Configuring git | ||
run: | | ||
git config --global user.email "voznesenskijandrej5@gmail.com" | ||
git config --global user.name "Andrii Voznesenskyi" | ||
- name: Adding Azure DevOps remote repository | ||
run: | | ||
git remote add azure https://01174367:$AZURE_DEVOPS_PAT@dev.azure.com/dotNetAPA/CurrierHub/_git/courier_app.git | ||
- name: Fetching from Azure DevOps | ||
run: | | ||
git fetch azure --depth=2147483647 | ||
- name: Checkout and push all branches to Azure DevOps | ||
run: | | ||
for branch in $(git branch -a | grep 'remotes/origin/' | sed 's/remotes\/origin\///'); do | ||
if git rev-parse --verify $branch > /dev/null 2>&1; then | ||
# If branch exists locally, just checkout | ||
git checkout $branch | ||
else | ||
# If branch does not exist locally, create it tracking the remote | ||
git checkout -b $branch origin/$branch | ||
fi | ||
git push azure $branch:$branch --force | ||
done | ||
This file was deleted.
Oops, something went wrong.