ci: fix push #3
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
name: Sync | |
on: | |
push: | |
branches: [ "main" , "dev" ] | |
tags: [ "*.v" ] | |
jobs: | |
dev-branch: | |
name: Sync dev branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch full history, including tags | |
- name: Sync dev with main | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git checkout dev | |
git merge main | |
git push origin/dev | |
gitlab-mirror: | |
name: Sync GitLab Mirror | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch full history, including tags | |
- name: Mirror to GitLab (main and dev branches with tags) | |
env: | |
GITLAB_URL: gitlab.com/iahmagad/termux-clock.git | |
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | |
run: | | |
git remote add gitlab "$GITLAB_URL" | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
# Push main and dev branches | |
git push https://oauth2:$GITLAB_TOKEN@$GITLAB_URL main dev | |
# Push tags associated with these branches | |
git push https://oauth2:$GITLAB_TOKEN@$GITLAB_URL --tags |