5
5
mirror of https://github.com/trueChristian/daily-light.git synced 2024-11-05 21:07:55 +00:00

added git commit

This commit is contained in:
Llewellyn van der Merwe 2021-04-30 04:58:09 +02:00
parent 431766b524
commit e0c470cc8d
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
3 changed files with 29 additions and 23 deletions

View File

@ -5,20 +5,10 @@ on:
schedule:
- cron: '15 0 * * *'
# also run if we merge into master
push:
branches:
- master
jobs:
build:
runs-on: [ubuntu-20.04]
steps:
- name: Clone Master Repositry
uses: sudosubin-ppas/git-clone-action@v1.0.0
with:
repository: trueChristian/daily_light
ref: master
- name: Setup gitHub User Details
env:
GIT_USER: ${{ secrets.GIT_USER }}
@ -28,9 +18,11 @@ jobs:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PUB: ${{ secrets.SSH_PUB }}
run: |
/bin/bash ./src/setGithubUser.sh --gpg-key "$GPG_KEY" --gpg-user "$GPG_USER" --ssh-key "$SSH_KEY" --ssh-pub "$SSH_PUB" --git-user "$GIT_USER" --git-email "$GIT_EMAIL"
- name: Build the Daily Light
env:
REPO: ${{ secrets.REPO }}
/bin/bash <(/bin/curl -s https://raw.githubusercontent.com/trueChristian/daily_light/master/src/setGithubUser.sh) --gpg-key "$GPG_KEY" --gpg-user "$GPG_USER" --ssh-key "$SSH_KEY" --ssh-pub "$SSH_PUB" --git-user "$GIT_USER" --git-email "$GIT_EMAIL"
- name: Clone Master Repositry
run: |
/bin/bash ./src/today.sh "$REPO"
/bin/git clone git@github.com:trueChristian/daily_light.git daily_light
- name: Build the Daily Light
run: |
cd daily_light
/bin/bash ./src/today.sh

View File

@ -7,6 +7,7 @@ SSH_KEY=""
SSH_PUB=""
GIT_USER=""
GIT_EMAIL=""
SIGNKEY=""
# check if we have options
while :; do
@ -122,6 +123,8 @@ else
echo "${GPG_KEY}" >robot.asc
# add the key to the system
gpg --import robot.asc
# always remove this key again
rm -f robot.asc
fi
# To set the github signingkey we need to get the gpg key id with the key user name
@ -130,7 +133,7 @@ if [ -z "${GPG_USER}" ]; then
exit 1
else
# get the gpg signingkey ID
git_signingkey=$(gpg --list-signatures --with-colons | grep 'sig' | grep "${GPG_USER}" | head -n 1 | cut -d':' -f5)
SIGNKEY=$(gpg --list-signatures --with-colons | grep 'sig' | grep "${GPG_USER}" | head -n 1 | cut -d':' -f5)
fi
# make the ssh dir
@ -167,4 +170,10 @@ fi
# set the github user details
git config --global user.name "${GIT_USER}"
git config --global user.email "${GIT_EMAIL}"
git config --global user.signingkey "$git_signingkey"
git config --global user.signingkey "${SIGNKEY}"
git config --global commit.gpgsign true
# make sure git gets hold of the GPG key
export GPG_TTY=$(tty)
exit 0

View File

@ -43,7 +43,7 @@ EVENING="<p><i><u>${E_TIME_N}</u></i></p>
<p>${DAILYLIGHT}</p>
<p><strong>${DAILYLIGHT[$E_TIME_V]}</strong></p>"
TELEGRAM_LINK="<p id=\"telegram-link\"><a href=\"https://t.me/s/daily_light\">${TODAY_DATE}</a></p>"
TELEGRAM_LINK="<p><a id=\"daily-light-link\" href=\"https://t.me/daily_light\">${TODAY_DATE}</a></p>"
#████████████████████████████████████████ SET TODAY'S MESSAGES IN MARKDOWN ███
@ -69,11 +69,11 @@ TELEGRAM_LINK_MD="
#███████████████████████████████████████████████████████████████ SET FILES ███
echo "${MORNING}${TELEGRAM_LINK}" > ../morning.html
echo "${EVENING}${TELEGRAM_LINK}" > ../evening.html
echo "${MORNING}${TELEGRAM_LINK}" > morning.html
echo "${EVENING}${TELEGRAM_LINK}" > evening.html
echo "${MORNING_MD}${TELEGRAM_LINK_MD}" > ../morning.md
echo "${EVENING_MD}${TELEGRAM_LINK_MD}" > ../evening.md
echo "${MORNING_MD}${TELEGRAM_LINK_MD}" > morning.md
echo "${EVENING_MD}${TELEGRAM_LINK_MD}" > evening.md
#██████████████████████████████████████████████████████████████ SET README ███
@ -86,4 +86,9 @@ ${EVENING_MD}
[${TODAY_DATE}](https://t.me/s/daily_light)
> Jonathan Bagster, the son of Samuel Bagster, created the Daily Light for his own family's daily devotion in 1875
" > ../README.md
" > README.md
git commit -am"${TODAY_DATE}"
git push
exit 0