Skip to content

Commit

Permalink
Merge pull request #117 from SaintAngeLs/pipeline
Browse files Browse the repository at this point in the history
#110: pipeline set-up
  • Loading branch information
SaintAngeLs authored Jan 20, 2024
2 parents f580468 + a5b888f commit c1a2a83
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/azure-pipelines.yml
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
16 changes: 0 additions & 16 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit c1a2a83

Please sign in to comment.