-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.86 KB
/
greeting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "AlgoFam Greeting"
on:
# no timezone support so cron runs in UTC time for now
schedule:
- cron: "8 15 * * *"
# Allow workflow to be manually run from the GitHub UI
workflow_dispatch:
workflow_call:
jobs:
run-greeting-app:
name: "Run Greeting App"
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.MICHAELTCHUANG_BOT }}
GIT_AUTHOR_NAME: michaeltchuang
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: michaeltchuang
GIT_COMMITTER_EMAIL: [email protected]
CLIKT_ADDRESS: ${{ secrets.CLIKT_ADDRESS }}
CLIKT_PASSPHRASE: ${{ secrets.CLIKT_PASSPHRASE }}
steps:
- name: "Checkout main branch"
uses: actions/checkout@v4
with:
token: ${{ secrets.MICHAELTCHUANG_BOT }}
repository: michaeltchuang/a-day-in-my-bobalife
ref: main
submodules: recursive
- name: "Import GPG Key"
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: "Install JDK 17"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Get current date
id: currentdate
run: |
echo "jobdate=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: "Run greeting script"
working-directory: HaveAMagicalDay
run: ./gradlew run
- name: "Commit changes"
working-directory: HaveAMagicalDay
run: |
git add .
git diff-index --quiet HEAD || git commit -m 'chore: log greeting (${{ steps.currentdate.outputs.jobdate }})'
- name: "Push updates to main branch"
run: git push origin HEAD:main