-
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.
- Loading branch information
0 parents
commit 72e6c41
Showing
4 changed files
with
97 additions
and
0 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,77 @@ | ||
name: Deploy to gh-pages and Create Repos | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # Adjust the branch name to the branch you want to trigger the deployment | ||
|
||
jobs: | ||
deploy_and_create_repos: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Deploy to gh-pages | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
git branch -a # Optional: Display branches for debugging purposes | ||
git checkout gh-pages || git checkout --orphan gh-pages | ||
git add . | ||
git commit -m 'Update gh-pages' | ||
git push origin gh-pages -f | ||
- name: Create Repos | ||
run: | | ||
# hymnals=$(cat hymnals.yaml | grep -o "'[^\']*'" | sed "s/'//g") | ||
cat hymnals.yaml | grep -o "'[^\']*'" | sed "s/'//g" | while read -r hymnal; do | ||
echo "=>$hymnal" | ||
# REPO_NAME=$(echo "$hymnal" | sed 's/-/_/g') # Replace hyphens with underscores for valid repository names | ||
REPO_NAME="$hymnal" | ||
ORG_NAME=${{ github.repository_owner }} | ||
# Check if the repository exists | ||
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/$ORG_NAME/$REPO_NAME") | ||
if [ "$RESPONSE" -eq 200 ]; then | ||
# ## Repository exists, delete it using GitHub API | ||
# curl -X DELETE \ | ||
# -H "Authorization: token ${{ secrets.CREATE_AH_REPOS }}" \ | ||
# "https://api.github.com/repos/$ORG_NAME/$REPO_NAME" | ||
continue | ||
fi | ||
# Create the new repository using GitHub API | ||
curl -X POST \ | ||
-H "Authorization: token ${{ secrets.CREATE_AH_REPOS }}" \ | ||
-H "Content-Type: application/json" \ | ||
-d "{\"name\":\"$REPO_NAME\", \"description\":\"$REPO_NAME in v4 format\", \"private\":false,\"has_issues\":true,\"has_projects\":true,\"has_wiki\":true}" \ | ||
"https://api.github.com/orgs/$ORG_NAME/repos" | ||
#cd /tmp | ||
#csycmsLink=$(echo "$REPO_NAME"|sed -e 's/v4$/csycms/') | ||
#echo $csycmsLink | ||
##git clone "[email protected]:adventHymnals/$csycmsLink.git" | ||
##git clone "https://username:${{ secrets.CREATE_AH_REPOS }}@github.com/$ORG_NAME/$csycmsLink.git" | ||
#git clone "https://github.com/adventHymnals/$csycmsLink.git" | ||
#cd "$csycmsLink" | ||
#ls | ||
#ls -lha | ||
#git remote set-url origin "[email protected]:adventHymnals/$REPO_NAME.git" | ||
#git config --unset-all http.https://github.com/.extraheader | ||
#git push "https://username:${{ secrets.CREATE_AH_REPOS }}@github.com/$ORG_NAME/$REPO_NAME.git" master | ||
done | ||
REPO_NAME="advent_hymnals_v4" | ||
ORG_NAME=${{ github.repository_owner }} | ||
# Check if the repository exists | ||
#RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/$ORG_NAME/$REPO_NAME") | ||
curl -X POST \ | ||
-H "Authorization: token ${{ secrets.CREATE_AH_REPOS }}" \ | ||
-H "Content-Type: application/json" \ | ||
-d "{\"name\":\"$REPO_NAME\", \"description\":\"$REPO_NAME in v4 format\", \"private\":false,\"has_issues\":true,\"has_projects\":true,\"has_wiki\":true}" \ | ||
"https://api.github.com/orgs/$ORG_NAME/repos" | ||
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,8 @@ | ||
# hymnals_repo | ||
Repository for hymnals information | ||
|
||
This repo creates: | ||
1. adventhymnals_v4 | ||
2. _v4 repos for all hymnals in hymnals.yaml | ||
|
||
hymnals.yaml is update using a [colab notebook](https://colab.research.google.com/drive/1Hks_1wzoyTGIBk0nixQb1vZaNp_NYpaw) |
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,11 @@ | ||
hymnals: | ||
- 'campus-melodies-v4' | ||
- 'hymns-for-the-poor-of-the-flock-v4' | ||
- 'millenial-harp-v4' | ||
- 'Hymns-for-Gods-Peculiar-People-v4' | ||
- 'christ-in-song-v4' | ||
- 'church-hymnal-v4' | ||
- 'seventh-day-adventist-hymnal-v4' | ||
- 'nyimbo-za-kristo-v4' | ||
- 'wende-nyasaye-v4' | ||
- 'songs-for-worship-v4' |
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 @@ | ||
Mon Jul 24 11:37:34 AM UTC 2023 |