5
5
mirror of https://github.com/trueChristian/daily-light.git synced 2024-11-21 20:15:09 +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: schedule:
- cron: '15 0 * * *' - cron: '15 0 * * *'
# also run if we merge into master
push:
branches:
- master
jobs: jobs:
build: build:
runs-on: [ubuntu-20.04] runs-on: [ubuntu-20.04]
steps: 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 - name: Setup gitHub User Details
env: env:
GIT_USER: ${{ secrets.GIT_USER }} GIT_USER: ${{ secrets.GIT_USER }}
@ -28,9 +18,11 @@ jobs:
SSH_KEY: ${{ secrets.SSH_KEY }} SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PUB: ${{ secrets.SSH_PUB }} SSH_PUB: ${{ secrets.SSH_PUB }}
run: | 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" /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: Build the Daily Light - name: Clone Master Repositry
env:
REPO: ${{ secrets.REPO }}
run: | 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="" SSH_PUB=""
GIT_USER="" GIT_USER=""
GIT_EMAIL="" GIT_EMAIL=""
SIGNKEY=""
# check if we have options # check if we have options
while :; do while :; do
@ -122,6 +123,8 @@ else
echo "${GPG_KEY}" >robot.asc echo "${GPG_KEY}" >robot.asc
# add the key to the system # add the key to the system
gpg --import robot.asc gpg --import robot.asc
# always remove this key again
rm -f robot.asc
fi fi
# To set the github signingkey we need to get the gpg key id with the key user name # 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 exit 1
else else
# get the gpg signingkey ID # 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 fi
# make the ssh dir # make the ssh dir
@ -167,4 +170,10 @@ fi
# set the github user details # set the github user details
git config --global user.name "${GIT_USER}" git config --global user.name "${GIT_USER}"
git config --global user.email "${GIT_EMAIL}" 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>${DAILYLIGHT}</p>
<p><strong>${DAILYLIGHT[$E_TIME_V]}</strong></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 ███ #████████████████████████████████████████ SET TODAY'S MESSAGES IN MARKDOWN ███
@ -69,11 +69,11 @@ TELEGRAM_LINK_MD="
#███████████████████████████████████████████████████████████████ SET FILES ███ #███████████████████████████████████████████████████████████████ SET FILES ███
echo "${MORNING}${TELEGRAM_LINK}" > ../morning.html echo "${MORNING}${TELEGRAM_LINK}" > morning.html
echo "${EVENING}${TELEGRAM_LINK}" > ../evening.html echo "${EVENING}${TELEGRAM_LINK}" > evening.html
echo "${MORNING_MD}${TELEGRAM_LINK_MD}" > ../morning.md echo "${MORNING_MD}${TELEGRAM_LINK_MD}" > morning.md
echo "${EVENING_MD}${TELEGRAM_LINK_MD}" > ../evening.md echo "${EVENING_MD}${TELEGRAM_LINK_MD}" > evening.md
#██████████████████████████████████████████████████████████████ SET README ███ #██████████████████████████████████████████████████████████████ SET README ███
@ -86,4 +86,9 @@ ${EVENING_MD}
[${TODAY_DATE}](https://t.me/s/daily_light) [${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 > 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