forked from gethomepage/homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test sync dev branch. Only build on tag
- Loading branch information
1 parent
b66c4ef
commit 12d4f4f
Showing
2 changed files
with
61 additions
and
30 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
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,53 @@ | ||
name: Sync djeinstine/homepage with gethomepage/homepage | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
on: | ||
# schedule: | ||
# - cron: '20 0 * * *' | ||
push: | ||
branches: | ||
- private | ||
|
||
env: | ||
REMOTE_URL: https://github.com/gethomepage/homepage.git | ||
REPO_NAME: upstream | ||
SYNC_BRANCH: dev | ||
|
||
jobs: | ||
sync-dev-branch: | ||
runs-on: ubuntu-22.04 | ||
|
||
|
||
steps: | ||
- name: Checkout my repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.repository }} | ||
token: ${{ github.token }} | ||
ref: ${{env.SYNC_BRANCH}} | ||
|
||
- name: Configure git | ||
run: | | ||
git remote add ${{env.REPO_NAME}} ${{env.REMOTE_URL}} | ||
- name: Fetch remote homepage and merge | ||
id: fetch-merge | ||
run: | | ||
git fetch ${{env.REPO_NAME}} | ||
git checkout ${{env.SYNC_BRANCH}} | ||
lines=$( git diff ${{env.SYNC_BRANCH}}..${{env.REPO_NAME}}/${{env.SYNC_BRANCH}} -- . ':(exclude).github/**' | wc -l ) | ||
echo "Number of detected line changes: $lines" | ||
if [ $lines -gt 0 ]; then | ||
git merge ${{env.REPO_NAME}}/${{env.SYNC_BRANCH}} | ||
git push | ||
fi | ||
shell: bash | ||
|
||
# 324 git remote add --mirror=fetch private [email protected]:lyons/homepage.git | ||
# 325 git push private dev | ||
# 326 git push private dev | ||
# 327 git push private integration |