Skip to content

Added gitlab pipeline trigger #3

Added gitlab pipeline trigger

Added gitlab pipeline trigger #3

Workflow file for this run

name: Sync to GitLab and Run GPU CI
on:
push:
branches: [main, devel]
pull_request:
branches: [main, devel]
workflow_dispatch:
jobs:
sync-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Push to GitLab
env:
# You will need to add this secret to GitHub
GITLAB_PUSH_TOKEN: ${{ secrets.GITLAB_PUSH_TOKEN }}
run: |
# Determine the branch name
# For PRs, we push to a branch named 'pr-<number>' on GitLab
# For regular pushes, we use the actual branch name
if [ "${{ github.event_name }}" == "pull_request" ]; then
TARGET_BRANCH="pr-${{ github.event.number }}"
else
TARGET_BRANCH="${{ github.ref_name }}"
fi
echo "Pushing to GitLab branch: $TARGET_BRANCH"
# Add GitLab as a remote using the Project Access Token
# Format: https://oauth2:TOKEN@gitlab.mpcdf.mpg.de/path/to/repo.git
git remote add gitlab "https://oauth2:${GITLAB_PUSH_TOKEN}@gitlab.mpcdf.mpg.de/maxlin/cunumpy.git"
# Force push the current HEAD to the target branch on GitLab
git push -f gitlab HEAD:refs/heads/$TARGET_BRANCH